PDA

View Full Version : Testing for current page



arpowers
01-25-10, 07:46 AM
Hi,

I need to test which page I'm on so I can highlight the navigation, the default portal template doesn't highlight the page based on the one you are on.

How can I tell which page I'm on using the Smarty Templates?

m00
01-25-10, 09:35 AM
This is how I do this:

<li{if $SCRIPT_NAME eq "/index.php"} class="selected"{/if}><a href="index.php">Home</a></li>
<li{if $SCRIPT_NAME neq "/index.php" AND $SCRIPT_NAME neq "/contact.php"} class="selected" onmouseover="dropdownmenu(this, event, clientarea_{if $loggedin}ac{else}un{/if}, '');" onmouseout="delayhidemenu();" onclick="window.location='clientarea.php'"{/if}><a href="clientarea.php">Client Area</a></li>
<li{if $SCRIPT_NAME eq "/contact.php"} class="selected"{/if}><a href="contact.php">Contact</a></li>

sparky
01-25-10, 01:02 PM
You can simply use

{$filename}

magga
01-26-10, 07:36 PM
Or {$pagetitle}, however sparky's above suggestion is more unique :)