Jump to content

How to replace a menu link 'text with an image link?


trent
 Share

Recommended Posts

Hello, you can replace a menu link 'text with an image link?
I mean, let's say that the menu item 'is "logan", i can replace the text logan, with a gif or png with the inscription logan? I hope I explained :wacko:

Thanks!

Share this post


Link to post
Share on other sites

Unless you use javascript, no, you can't

 

At leaset, I've never seen this functionality in the tmcategories module

I have seen a site like this where instead the change had been made.

From the code I've seen, it seems that the change (hook) has been made with:

 

{if ($node.item=='child')}

<li class="{if isset($last) && $last == 'true'} last{/if}">

<a href="{$node.link}" {if isset($currentCategoryId) && ($node.id == $currentCategoryId)}class="selected"{/if}>

{$node.name|escape:html:'UTF-8'}

</a>

{else}

<li class="{if $node.children|@count > 0}sub{/if}{if isset($last) && $last == 'true'} last{/if}">

 

<a href="{$node.link}" {if isset($currentCategoryId) && ($node.id == $currentCategoryId)}class="selected"{/if}>

 

{if !($node.id==2)&&!($node.id==9)&&!($node.id==10)&&!($node.id==11)&&!($node.id==12)&&!($node.id==13)&&!($node.id==14)&&!($node.id==16)}

    {$node.name|escape:html:'UTF-8'}

{else}

    {if ($node.id == $currentCategoryId)}

        <IMG SRC="./themes/mytheme/img/menu/{$node.name}-roll.png"  align="bottom">

    {else}

        <IMG SRC="./themes/mytheme/img/menu/{$node.name}-on.png"  align="bottom" onmouseover='this.src = "./themes/mytheme/img/menu/{$node.name}-roll.png";' onmouseout="this.src='./themes/mytheme/img/menu/{$node.name}-on.png';">

    {/if}

  

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More