Print string with html tags

In my template I need to print a string with some html tags in it.

Let's say I have:

$my_string = "This is my string with a <a href="https://xenforo.com">link</a>"

If I use the simple {$my_string} the html tags won't be parsed and will be displayed as string.

I didn't find any documentation about how to parse this kind of string. Any suggestions?
 
Thank you @Chris D ! That's exactly what I was looking for.
Can you tell me where is the reference of this xen directive, if there's any?
I wonder how come I didn't find it by myself o_O
 

Chris D

XenForo developer
Staff member
There's no documentation, as such, but it is used in places in the existing templates.

It should be used sparingly. It essentially prevents the value from being escaped which is usually preferable to avoid being open to XSS vulnerabilities.

In terms of seeing what else there is, you could search templates for {xen: to see what else there is. There's some more prevalent than others, such as {xen:phrase and {xen:link.
 
Top