Show button/link in header as active
| aro747 |
|
|---|---|
|
Hi all, I'm trying to get the button in the main nav to stay 'active' when viewing pages within that category. Unfortunately, when viewing a page in that category, I'm getting more than one button to become active. I have in header.tpl:
<li class="<!-- IF {PHP.m} == 'page' OR {PHP.env.ext} == 'page' -->active<!-- ENDIF -->"><a href="{PHP|cot_url('page', 'c=profiles')}">Profiles</a></li>
<li class="<!-- IF {PHP.m} == 'page' OR {PHP.env.ext} == 'page' -->active<!-- ENDIF -->"><a href="{PHP|cot_url('page', 'c=cars')}">Cars</a></li>
When viewing a page in the 'Cars' category, the 'Profiles' button also becomes active. How can I fix it? Thanks for your help. |
| Yusupov |
|
|---|---|
|
The condition for profiles link:
<!-- IF ({PHP.env.location} == 'pages' OR {PHP.env.location} == 'list') AND ({PHP.c|cot_structure_parents('page', $this, 'first')} == 'profiles' OR {PHP.pag.page_cat|cot_structure_parents('page', $this, 'first')} == 'profiles') -->active<!-- ENDIF -->
The condition for cars link:
<!-- IF ({PHP.env.location} == 'pages' OR {PHP.env.location} == 'list') AND ({PHP.c|cot_structure_parents('page', $this, 'first')} == 'cars' OR {PHP.pag.page_cat|cot_structure_parents('page', $this, 'first')} == 'cars') -->active<!-- ENDIF -->
|
| aro747 |
|
|---|---|
|
Thank you very much! Works great. |