the URL is like: myweb.com/home/8-sticker-papdie.html
I use:
{if $smarty.server.SCRIPT_URI|strstr:"home"}
Display message "YES"
{else}
None
{/if}
When I run it I can only see "None".
What I am doing wrong?
the URL is like: myweb.com/home/8-sticker-papdie.html
I use:
{if $smarty.server.SCRIPT_URI|strstr:"home"}
Display message "YES"
{else}
None
{/if}
When I run it I can only see "None".
What I am doing wrong?
You can just use the value of $_SERVER['HTTP_HOST']
:
{if strstr($_SERVER['HTTP_HOST'], 'home') !== false}
Display message "YES"
{else}
None
{/if}
Try this it will help you :
{if $smarty.server.REQUEST_URI|strstr:"home"}
Display message "YES"
{else}
None
{/if}