Hi there everyone!
I've got a page that calls a template, which has a breadcrumb system. Basically, when on general settings, I need a way to highlight that menu item.
<img src = '1.jpg' class='selected' />
<img src = '2.jpg' />
<img src = '3.jpg />
if the settings page is active, then, the first menu image has the class applied. If users page is active, the second menu item should have it and if the permissions page is active, then the third image has it.
Currently, I use a variable at the top of the host page to handle it. For instance on the settings page:
$settings_selected = ' class='selected';
and at the top of my template, I have this:
if(!ISSET($settings_selected)){
$settings_selected = '';
}
if(!ISSET($users_selected)){
$users_selected = '';
}
if(!ISSET($permissions_selected)){
$permissions_selected = '';
}
then in the template:
<img src = '1.jpg'".$settings_selected." />
<img src = '2.jpg'".$users_selected." />
<img src = '3.jpg'".$permissions_selected." />
All of this works, but with each new page, I have to set up all of the vars over again and it's quite time consuming. I'm sure there's a far zoomier way to handle this but I'm not savvy enough to know what that method might be.
Would someone mind sharing a better way to handle something of this sort?
Thanks for your time!