Reputation: 488
I currently edit one template of WHMCS, it's written by Smarty.
Can I use something simple like
{if $is_homepage}
show something
{/if}
Which homepage is loaded from homepage.tpl, mean index page. Because I want to load some code, just in homepage only. Thanks.
Upvotes: 1
Views: 3231
Reputation: 11
Use this instead if you desire optimized code.
{if $filename eq "index"}
your code here
{/if}
you don't have to include the filename extension like .tpl (just in case you were wondering)
Upvotes: 1
Reputation: 1200
quite hacky but you might try something like this:
{if ($smarty.server.SCRIPT_NAME eq "/index.php")}
{/if}
Upvotes: 1