0

I am building prestashop module where in configuration page I have input filed where user is supposed to enter block of javascript code.

I get that code and save it to smarty but when I put it in smarty like

<script> 
    {$all_pages_tags}
</script>

I get it like string. How can I exit string and use this value as a block of code.

  • 1
    Does this answer your question? [Smarty displays raw HTML](https://stackoverflow.com/questions/21242713/smarty-displays-raw-html) – Nico Haase Aug 07 '20 at 16:09

1 Answers1

0

There are special tags for escaping javascript-code in smarty.

For escaping javascript code with smarty variables inside you need to use {ldelim},{rdelim} like this:

<script> 
{ldelim}
    {$all_pages_tags}
{rdelim} 
</script>

Taken from the smarty documentation: here

Christoph Kern
  • 419
  • 2
  • 7