When it comes to highlighting the active page in a navbar I find myself using if conditions, just what I've grown accustomed to.
Example: (may not be perfect, just going from the top of my head)
HTML Code:
<a href="" class="class<if condition="(THIS_SCRIPT=='index')"> active</if>">Home</a>
<a href="" class="class<if condition="($_REQUEST['do']=='page')"> active</if>">Page</a>
<a href="" class="class<if condition="in_array(THIS_SCRIPT, array(showthread,forumdisplay))"> active</if>">Threads</a>
<a href="" class="class<if condition="($_REQUEST['do']!='AD')"> active</if>">Highlight if not active</a>
I was wondering to avoid the multiple if's, is their an easier way (or better way) for achieving this concept?
I'm asking here rather than on stack because we are vBulletin users, and a lot of stack members tend to have issues with vb lol, and maybe vb has a whole different way of detecting the current page.