Jump to content
We want to feature your community! ×

Community

How do I pass variable to media function in templates


VarunAgw
 Share

Go to solution Solved by Sonya*,

Recommended Posts

{{$selectIcon = "icons/select-" . $selectLogoSize . ".svg";}}
<img src="{media="{$selectIcon}"}" />

That's how my code looks like, but for some reason, second line doesn't work. But if I remove the variable and manually enter the path as static, it works. How do I fix it?

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We use technologies, such as cookies, to customise content and advertising, to provide social media features and to analyse traffic to the site. We also share information about your use of our site with our trusted social media, advertising and analytics partners. See more about cookies and our Privacy Policy