I want to populate a hero block using a background image from a node field. I don’t want the user to interact with Layouts at all.
So the client creates a node (of content type ‘Section’) and uploads an image to ‘banner’ field. My layout uses a hero block, but my custom hero block tpl.php doesn’t know about $node.
How can I get the banner image field values into my template? Does this require a preprocess function? And would it be easier just to build a View block with a Nid relationship?
Thanks
Comments
Hi Jim
Take a look at Smart Blocks and see if that does what you need
You could also try Current Content Display Block which with a bit of config and CSS could get you what you need.
Have you looked at the BG Image Formatter
https://github.com/backdrop-contrib/bg_image_formatter