XF 1.4 Can you use LIKE conditionals?

Phases

Active member
Licensed customer
I'm trying to do something like this:
Code:
<xen:if is="{$forum.title} LIKE 'root'">

or

Code:
<xen:if is="{$forum.title} == '%root%'">

or something similar I've tried a few things. Is there a way to do this? Looking for basically any forum name with the word root in it to be returned true. Appreciate any help!

Edit: Answer posted below:

Code:
<xen:if is="strpos({$forum.title}, 'root') !== false">
Should work.

stripos is the case insensitive version just FYI
 
Last edited:
I have never actually tested that but I don't believe it's possible to do a partial match on a variable in that manner.
 
In the words of my wise 'ol man, Dag-gummit.

Hopefully we'll be surprised with someone swooping in to save the day.

Thanks,
 
Back
Top Bottom