0

Here is the contents of a Smarty template file...

{foreach from=$productcustomfields item=customfield}
<tr>
  <td class="fieldarea">{$customfield.name}:</td>
  <td>{$customfield.value}</td>
</tr>
{/foreach}

When the {$customfield.value} is rendered on screen, any HTML tags from that array value are shown as plain text in the browser. How can I get Smarty to actually render the HTML tags instead of taking them as literal text?

For example, if a value of $customfield.value was...

<strong>Hello</strong>

It would appear just like that in the browser and not as Hello as it should.

2
  • 1
    Do you have registerFilter('variable','htmlspecialchars') somewhere on your Smarty object? Commented Oct 14, 2013 at 20:58
  • I can't be sure. This template file is from encoded and licensed software so I don't have access to that information. Commented Oct 14, 2013 at 21:09

1 Answer 1

1

Try with

{$customfield.value nofilter}

(See reference)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.