top_menu.tpl dynamic categorie tabs

[COLOR=“Black”]Im making a dynamic css tab menu on top_menu.tpl.



I create the following code to get all the categorie names/links in a for/each.



[/COLOR]


[COLOR=“Red”][B] {foreach from=$categories item=category key=cat_key name=‘categories’}


  • {$category.category|escape:html}



  • {/foreach}
    [/B][/COLOR]

    thats work perfect, and add a tab menu on top_menu.tpl for each categorie.


    [COLOR="Black"][B]My issue

    considering this is a dynamic menu, Is there a way i can know what button was selected by the user?

    I want to change the color tab when the user click on it.

    Im trying to do something like this:
    [/B][/COLOR]


    [COLOR="Red"][B]

    {if $current_url == "my selected button"}



    {else}



    {/if}
    [/B][/COLOR]

    [B][COLOR="Black"]

    I can't figure out how to make the comparative to know whats the selected button.

    Help must be very appresiated.

    Thanks for read

    Jema.[/COLOR][/B]