- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Problem with HubL image module
SOLVEFeb 23, 2018 10:07 PM
I am trying to use an image module as the background of a div, so that I can change the image in the wysiwyg editor.
I have the code set up as
<section style="width:100%; height:960px;background:url({% image 'Hero_image' label='Hero Image', alt='Hero Image', src="../hero-1600x960.png" %}'); background-repeat: no-repeat; background-position: center; background-size:cover; background-attachment: scroll;">
What I get is the image followed by
'); background-repeat: no-repeat; background-position: center; background-size:cover; background-attachment: scroll;">
Is the second curly bracket causing a problem? Do I need to do something with **bleep** characters? Is there another way to do this? Any other thoughts?
Thanks,
Jonathan
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Accepted Solutions
Feb 25, 2018 4:45 AM - edited Feb 25, 2018 4:48 AM
Image renders an image tag, which you don't need..
You only want to render an image url, using: image_src
so what you need is this:
<section style="width:100%; height:960px;background:url('{% image_src "image_src" src="-URL-to-image-placeholder.jpg", no_wrapper=True %}'); background-repeat: no-repeat; background-position: center; background-size:cover; background-attachment: scroll;">
More info?
https://designers.hubspot.com/docs/hubl/hubl-supported-modules#image-src
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content