Question about adding Hero image in Mercury theme
-
September 22, 2020 at 2:28 am #3831[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?
September 24, 2020 at 2:53 am #3860[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? 🙄
September 29, 2020 at 12:56 am #3908[anonymous]Anyone has experience about adding a Hero image on tag page?
September 30, 2020 at 9:10 pm #3914[anonymous]The new version of Publii (0.37) does have a Featured image option for the tag pages. Does that solve your problem?
October 5, 2020 at 1:51 am #3960[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?
October 5, 2020 at 2:04 am #3961Bob[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.
October 8, 2020 at 2:24 am #3986[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.
October 8, 2020 at 4:59 am #3987Bob[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.
October 8, 2020 at 5:42 am #3989[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}}
October 8, 2020 at 5:44 am #3990Bob[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.