{if summary_field == "some-text"}
do something
{/if}
is there a ‘like’ equivalent of this?
Something like:
{if summary_field LIKE "%some-text%"}
do something
{/if}
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
April 20, 2011 3:16pm
Subscribe [2]#1 / Apr 20, 2011 3:16pm
{if summary_field == "some-text"}
do something
{/if}
is there a ‘like’ equivalent of this?
Something like:
{if summary_field LIKE "%some-text%"}
do something
{/if}
#2 / Apr 20, 2011 3:30pm
I think you’d either need to use some PHP to do that or create a plugin to do the same sort of thing.
There are a couple of plugins out there that allow you to use something like strpos but I think they just return the position at which the text occurs as opposed to if it occurs or not.
Best wishes,
Mark
#3 / Apr 20, 2011 3:34pm
I found this one PHPStringFun.
If they return a position then the text occurs!
thanks
ip
#4 / Apr 20, 2011 5:01pm
No problem. That was actually the one I was thinking of but I wasn’t sure if it just output the position or whether there’s a conditional you can use.
Best wishes,
Mark