mwbarker Posted July 4, 2009 Share Posted July 4, 2009 I have 2 links in my menu pointing to WHMCS; is it possible to put logic into the header.tpl file that would determine if the current page is a specific page and change the menu based on that. In other words, my menu looks like this: <li><a href="../clients/domainchecker.php"><span>DOMAINS</span></a></li> <li><a href="../clients/" class="current"><span>CLIENTS</span></a></li> Is there any way to make it look like this? {if currenturl=domainchecker.php} <li><a href="../clients/domainchecker.php" class="current"><span>DOMAINS</span></a></li> <li><a href="../clients/"><span>CLIENTS</span></a></li> {else} <li><a href="../clients/domainchecker.php"><span>DOMAINS</span></a></li> <li><a href="../clients/" class="current"><span>CLIENTS</span></a></li> {/if} In other words, determine if the current URL points to domainchecker.php and if so, apply class="current" to it; otherwise, apply it to the CLIENT link? 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted July 4, 2009 Share Posted July 4, 2009 I have 2 links in my menu pointing to WHMCS; is it possible to put logic into the header.tpl file that would determine if the current page is a specific page and change the menu based on that. In other words, my menu looks like this: <li><a href="../clients/domainchecker.php"><span>DOMAINS</span></a></li> <li><a href="../clients/" class="current"><span>CLIENTS</span></a></li> Is there any way to make it look like this? {if currenturl=domainchecker.php} <li><a href="../clients/domainchecker.php" class="current"><span>DOMAINS</span></a></li> <li><a href="../clients/"><span>CLIENTS</span></a></li> {else} <li><a href="../clients/domainchecker.php"><span>DOMAINS</span></a></li> <li><a href="../clients/" class="current"><span>CLIENTS</span></a></li> {/if} In other words, determine if the current URL points to domainchecker.php and if so, apply class="current" to it; otherwise, apply it to the CLIENT link? {if $smarty.server.PHP_SELF == '/domainchecker.php'} <li><a href="../clients/domainchecker.php" class="current"><span>DOMAINS</span></a></li> <li><a href="../clients/"><span>CLIENTS</span></a></li> {else} <li><a href="../clients/domainchecker.php"><span>DOMAINS</span></a></li> <li><a href="../clients/" class="current"><span>CLIENTS</span></a></li> {/if} OR {if $pagetitle == 'domainchecker'} <li><a href="../clients/domainchecker.php" class="current"><span>DOMAINS</span></a></li> <li><a href="../clients/"><span>CLIENTS</span></a></li> {else} <li><a href="../clients/domainchecker.php"><span>DOMAINS</span></a></li> <li><a href="../clients/" class="current"><span>CLIENTS</span></a></li> {/if} 0 Quote Link to comment Share on other sites More sharing options...
mwbarker Posted July 5, 2009 Author Share Posted July 5, 2009 Thanks! I used $pagetitle, which worked like a charm. Any reason to choose one way over the other? 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.