Sign in

Different hero image on different tag page and post page

  • This topic has 4 replies, 2 voices, and was last updated 1 month, 1 week ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #3794
    flim

    I want a different banner image on different custom tag page and post page, but since there is no media library, is it possible to add external image to the template?

    If that possible maybe I could also add carousel banner.

    #3795
    flim

    I noticed that there is a customHTML.beforePost in Mercury theme, so I think I can add a banner there. I can upload file in Tools->File manager, but how can I access to media/files in hbs code?

    #3796
    Bob
    Support

    All files that you will use in the source .hbs file should be served from the assets folder. Thanks to the @website.assetsUrl variable (https://getpublii.com/dev/website-global-variable/) you can easily access these files e.g. {{@website.assetsUrl}}/images/your_image.png

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #3799
    flim

    I see. Thanks for the clarification.

    I read the doc again,

    The File Manager tool allows for advanced users to inspect all the files generated for their website

    So the media folder is not for template use.

    #3800
    Bob
    Support

    So the media folder is not for template use.

    It may be but I do not recommend it, al the files used in the theme should be stored in the assets folder.

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Different hero image on different tag page and post page’ is closed to new replies.