I added a new tab to top_menu.tpl but the tab color does not change when active. The “Air Force” tab links to a product category called “air-force”. I made the modification per the knowledgebase but admit I don’t understand coding very well.
The site is honorcountry.com and here is the code I inserted into top_menu.tpl to create the tab. I hope someone can help me figure this out. I do have SEO turned on. Also, I would appreciate knowing if a reference exists which explains about $target, $mode, and fn_redirect. I have a fair understanding of css and html. Thanks in advance to anyone who can assist.
```php
{if $target == ‘airforce’}
{assign var=‘but_active’ value=‘-active’}
{else}
{assign var=‘but_active’ value=‘’}
{/if}
Well actually, in category pages, the url looks like this:
{$index_script}?{$target_name}=categories&category_id={$category.category_id}
Not like this:
{$index_script}?{$target_name}=air_force
- You need to find what the category_id is for your air force category page.
1.a. You can find this by temporarily turning off SEO.
- Then in top_menu.tpl, for the {if} statement, use this:
{if $target == ‘categories’ && $category.category_id == [COLOR=Red]##[/COLOR]}
This will work like this even when SEO is on.
Thanks Matt for the response. The Air Force tab still does not change color when clicked, but the link works. I will keep trying but here’s the code if you have a chance. I changed the hi-lited text from yours because there were no products being found using ‘category_id={$category.category_id’ in the url.
{if $target == 'categories' && $category.category_id == '811'}
{assign var='but_active' value='-active'}
{else}
{assign var='but_active' value=''}
{/if}