- This topic has 8 replies, 2 voices, and was last updated 5 years, 4 months ago by
Leo.
-
AuthorPosts
-
August 19, 2018 at 6:46 am #653382
Viktor
I am new to GP.
I created the Element as a Header type. I selected a custom image as a background. Everything looks OK if I add some text.
But, I can not figure out how to display background header image at full size without text. Without text, the HEADEr does not show at all.
https://www.staging.phototraces.com/deconstructing-photo/hiking-in-kodachrome-utah/
Thanks
August 19, 2018 at 7:17 am #653401David
StaffCustomer SupportHi there,
try adding an empty span tag in the Hero content e.g
<span></span>I’ll pass this onto Tom as i cannot see the warning that used to appear on Page Headers when the content was empty….
August 19, 2018 at 7:32 am #653418Viktor
sure adding <span></span> does work, but then I have to specify exact Padding for each image to display it at full size.
August 19, 2018 at 7:50 am #653532David
StaffCustomer SupportHi there,
that is correct as the image is set as a CSS background image with the size set to cover, so you need to define the padding required to display more of the image.
Your alternative would be to add the image in the content using an image tag which would then be displayed at the actual size without padding.
August 19, 2018 at 8:28 am #653554Viktor
got it
thanksAugust 19, 2018 at 8:36 am #653558David
StaffCustomer SupportYou’re welcome.
August 19, 2018 at 8:45 am #653566Tom
Lead DeveloperLead DeveloperI prefer an empty HTML comment to an empty span, seems cleaner:
<!-- Page Hero -->November 15, 2020 at 12:33 pm #1532628ideawrights
I understand the logic here, but one of the useful things about the page header module is that it allows people with fairly limited skills to upload an image, add some text and then have a nice header. But if they don’t want text in the header, they’re left scratching their heads. Why isn’t my header showing?
As it stands now, without content, it won’t generate any HTML at all, so you can’t force a default height.
It would be nice if there were either a flag (“Always show header”) or a hook (generate_hero_add_after_content) so then as a site builder, you could make this automatic for an end user and not have to instruct them to add an HTML comment in order to get this to work.
November 15, 2020 at 2:55 pm #1532713Leo
StaffCustomer SupportCan you open a new topic for your question?
This topic is from 2018 which is quite old.
Thanks!
-
AuthorPosts
- The topic ‘Displaying Header Image without text’ is closed to new replies.