CMS Development

vin-aws
Contributeur

Beta Design Manager module_asset_url() not working

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 Votes
2 Réponses
tjoyce
Expert reconnu | Partenaire solutions Elite
Expert reconnu | Partenaire solutions Elite

Beta Design Manager module_asset_url() not working

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 Votes
vin-aws
Contributeur

Beta Design Manager module_asset_url() not working

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 Votes