Using Smarty Tags I’d like to determine if an URL contains a word, something like:
{if $smarty.get.page contains "product.php"} .....
I know contains doesn’t exist, but how could I easily go about writing something similar to achieve the above code?
You can use
strposto check if a string has another string inside of it.Except you need to wrap it in
{php}and{/php}.$smarty.get.pagetranslates to$_GET['page'], so you could replace it with the GET variable as well.