Search code examples
htmlsmarty

show a smarty variable with html content


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?


Solution

  • You should try this:

    {$html|unescape:'html'}
    

    Also check manual:

    http://www.smarty.net/docs/en/language.modifier.unescape.tpl