Archived topic
Block Page Hero - fixed width/height dynamic featured image
5 replies · Started by Baz on April 24, 2021
Hi, I'm not sure if this option is somewhere in the elements settings.
I'm using a Block Element (GP 2.0rc3) to show post-title with a 'dynamic' featured image below:
Container =>
Container => Dynamic Post Title
Container => Dynamic Featured Image
I want the featured image to keep the same dimensions (960x540) and shrink just like a standard featured image. Is there a setting which removes the background scrolling effects?
If you have a better suggestion of adding a featured image to a page hero block like above, I would be glad to know :)
Thank you.
Hi Baz,
Is there a setting which removes the background scrolling effects?
Not sure I fully understand your question. Could you link us to the site in question?
Hi Ying, I can't show you a live example but you can see what I mean here: https://ibb.co/F81f534
I don't want the featured image to be 'cropped' on mobile view but remain at the same proportions as the desktop image.
This may be the result of using a featured image as a background-image in GP2.0
This is how I want the featured image to look on mobile: https://ibb.co/P4hgXG8
Hope this explains it a bit more.
Thanks.
Hi there,
the simplest method would be to replace the Container Block with the featured image background for the GP Dynamic Image Block. This will maintain its aspect ratio.
Alternative edit the Container and change the padding options to % - now add top and bottom padding to match the images aspect ratio.
ie. Aspect Ratio = H / W * 100
Which is 540 / 960 * 100 = 56%.
Set Top and Bottom padding to 28% each.
the simplest method would be to replace the Container Block with the featured image background for the GP Dynamic Image Block. This will maintain its aspect ratio.
Silly me, never thought of using the 'Dynamic Image' option :)
This now works as wanted, thank you Ying, and David.
Glad we could be of help!
And great to see how you're using the new dynamic block element :)