Beta Design Manager module_asset_url() not working

vin-aws
Contributor

Trying to access an image uploaded into a custom module. Image is uploaded with name 'next.jpg'. Trying to access and set it as a background image in the CSS with:

background-image:  url({{ module_asset_url('next.png') }});

per the documentation. However, it isn't being read in the preview page. Inspect element shows it coming up as: 

background-image: url({{ module_asset_url%28'next.png'%29 }})

So the parentheses are being replaced by HTML encoding.

0 Upvotes
2 Replies 2
tjoyce
Recognized Expert | Platinum Partner

You can only use module_asset_url in a custom module in the template. If you are trying to use it in the page editor, you are probably going to run into issues. 


If this answer helped, please, mark as solved 😄


tim@belch.io | forms.belch.io | Design your own Beautiful HubSpot Forms; No coding necessary.

 

Drop by and say Hi to me on slack.

0 Upvotes
vin-aws
Contributor

Not quite sure what you mean. I am using it in a custom module and viewing it in the preview next to 'Publish Changes'

0 Upvotes