Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Question about adding Hero image in Mercury theme

  • #3831
    Avatar photo[anonymous]

    I want to add a Hero image to the Mercury theme, I use the Tattoo theme as reference. Is it copy the Hero related config.json setting, main.css and modify the hbs to get the job done?

    #3860
    Avatar photo[anonymous]

    I am wondering where Publii store the Hero image. If I have a few tag pages, each with different hero, should I hard code the hero image in each tag template, or adding a section in config file for each template? 🙄

    #3908
    Avatar photo[anonymous]

    Anyone has experience about adding a Hero image on tag page?

    #3914
    Avatar photo[anonymous]

    The new version of Publii (0.37) does have a Featured image option for the tag pages. Does that solve your problem?

    #3960
    Avatar photo[anonymous]

    I tried to upload an image that is 1920 x 930 jpeg but the Upload progress never completed. I tried a small gif and success. Any size limit for the Tag’s Featured image?

    #3961
    Avatar photoBob
    [anonymous] wrote:

    I tried to upload an image that is 1920 x 930 jpeg but the Upload progress never completed. I tried a small gif and success. Any size limit for the Tag’s Featured image?

    The tags featured images are available in v.2.2.0.0 Mercury theme; after installing, if it still doesn’t work for you, it means that you override the config,json file, and need to merge with the latest version.

    PS: The .gif or .svg files work because Publii does not generate thumbnails for this type of extensions.

    #3986
    Avatar photo[anonymous]

    Finally I can upload image from my local hard drive. Upload from network drive didn’t work.

    I tested with the “vanilla’ Mercury 2.2.0, but the Featured image didn’t shown up. I check the tag.hbs, it seems Mercury theme didn’t utilize the Featured image in tag page.

    #3987
    Avatar photoBob
    [anonymous] wrote:

    I tested with the “vanilla’ Mercury 2.2.0, but the Featured image didn’t shown up. I check the tag.hbs, it seems Mercury theme didn’t utilize the Featured image in tag page.

    https://demo.getpublii.eu/themes/mercury/1/tags/

    #3989
    Avatar photo[anonymous]

    Oh I mean the Featured image of individual Tag page, not the Tags page. I want to show the Featured image just below the navbar, like the Tattoo theme.

    This snippet found in Tattoo theme’s tag.hbs, but not exists in Mercury theme, I am checking how to incorporate this in Mercury theme.

    {{#featuredImage}}
       {{#if url}}
          <figure class="hero__image">
             <img
                src="{{url}}"
                {{#if @config.site.responsiveImages}}
                   {{responsiveImageAttributes 'tagImage' srcset.tag sizes.tag}}
                {{/if}}
                {{ lazyload "eager" }}
                height="{{height}}"
                width="{{width}}"
                alt="{{alt}}">
    
             {{#checkIfAny caption credits}}
                <figcaption>
                   {{caption}}
                   {{credits}}
                </figcaption>
             {{/checkIfAny}}
          </figure>
       {{else}}
          {{#checkIfAll @config.custom.uploadHero @config.custom.displayHeroImage}}
             <figure class="hero__image">
                <img
                   src="{{@config.custom.uploadHero}}"
                   {{#if @config.site.responsiveImages}}
                      {{responsiveImageAttributes @config.custom.uploadHero}}
                   {{/if}}
                   {{ lazyload "eager" }}
                   {{imageDimensions @config.custom.uploadHero}}
                   alt="{{@config.custom.uploadHeroAlt}}">
    
                {{#if @config.custom.uploadHeroCaption}}
                   <figcaption>
                      {{@config.custom.uploadHeroCaption}}
                   </figcaption>
                {{/if}}
             </figure>
          {{/checkIfAll}}
       {{/if}}
    {{/featuredImage}}
    #3990
    Avatar photoBob
    [anonymous] wrote:

    This snippet found in Tattoo theme’s tag.hbs, but not exists in Mercury theme

    Our existing themes have been updated to support the majority of these new features, however, do be aware that not all of these features are available on every theme; in some cases, the styling or design of the theme means that adding e.g. featured images to a tag or author page is not really possible, and this is why you can not find it on the Mercury theme.

    PS: Our support doesn’t include custom development or customization. If you need some extra features or elements in our themes, feel free to contact us via https://getpublii.com/customization-service/ page.