Search code examples
smarty

Smarty 3: how can I output a variable and not have html entities converted?


In a specific template, I'd like to be able to output a variable, and not have the quotes, such as ' turned into html entity codes (')

How can I do that without affecting how the rest of the system is working?

I've tried:

{$var|escape:'html'}

{$var|escape:'htmlall'}

{$var|unescape}


Solution

  • To make a variable exempt from default modifiers, add the 'nofilter' attribute to the output tag such as {$var nofilter}