show a smarty variable with html content

user985409 picture user985409 · May 8, 2013 · Viewed 28.4k times · Source

I have a smarty variable with html content in it like: $html="<strong>Content</strong><br/>etc etc" . I try to show it html-formatted. When showing it like {$html} only plain text appears without formatting. I try like: {$html|unescape} but then the tags are shown but not applied. Do you have any suggestions?

Answer

dhaupin picture dhaupin · Nov 24, 2015

Interestingly, none of the answers here work with Smarty 3.1.21 on CS-Cart 4.3.4. So, just to add another thought in that circumstance, use the nofilter on the $html string like so:

{$html nofilter}