Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Html In Custom .tpl File Not Parsed Rate Topic   * * * * * 1 votes

 
  • RagingRaven
  • Member
  • Trial users
  • Join Date: 26-Mar 13
  • 44 posts

Posted 13 July 2015 - 12:51 PM #1

I'm trying to show a variable with some html in it on a custom template file (.tpl), but the html is not being parsed, but shown in the page.

So I have a variable with some html: $variable = 'line 1<br />line 2';
Expected output:

line1
line2

Real output:
line1<br />line2

Viewing source I see that this is because the html tags are being escaped:
line1&lt;br /&gt;line2

So I tried using escape (both html and htmlall):
{$error|unescape:'html'}
{$error|unescape:'htmlall'}

But neither appears to work.

Info: I'm on CS-Cart 4.3.3

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19056 posts

Posted 13 July 2015 - 03:38 PM #2

Use

{$error nofilter}

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • RagingRaven
  • Member
  • Trial users
  • Join Date: 26-Mar 13
  • 44 posts

Posted 13 July 2015 - 04:05 PM #3

I'll give it a try, thanks!

 
  • RagingRaven
  • Member
  • Trial users
  • Join Date: 26-Mar 13
  • 44 posts

Posted 14 July 2015 - 09:28 AM #4

Thanks eCL, that did the trick.
:mrgreen:

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19056 posts

Posted 14 July 2015 - 11:31 AM #5

You are welcome! :)

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.