1
wilbury
how to add icons to the main menu
  • 2004/3/2 23:43

  • wilbury

  • Just popping in

  • Posts: 13

  • Since: 2004/3/2 2


i would like to put a little icon to every module on the main menu...anybody know how to? thanks a lot

2
Bleekk
Re: how to add icons to the main menu
  • 2004/3/2 23:46

  • Bleekk

  • Theme Designer

  • Posts: 940

  • Since: 2002/12/14


I think you can do it in the CSS files

3
rabideau
Re: how to add icons to the main menu
  • 2004/3/3 0:18

  • rabideau

  • Home away from home

  • Posts: 1042

  • Since: 2003/4/25


The only way I know is to create a gif (background image for your menu item) Then call the gif file as a background image for your button in the style.css, If you'd like to see an example you can go tohttp://www.fbctogether.org I have the images appearing in all the submenus (I don't use them at the top level).

Bon chance!

4
wilbury
Re: how to add icons to the main menu
  • 2004/3/11 20:51

  • wilbury

  • Just popping in

  • Posts: 13

  • Since: 2004/3/2 2


but that way all the items would have the same icon...i would like tu put a special icon for each option

5
wilbury
Re: how to add icons to the main menu
  • 2004/3/11 21:01

  • wilbury

  • Just popping in

  • Posts: 13

  • Since: 2004/3/2 2


here's an example of what i want:
Here
it's arabic so the menu is on the righ side...see what i mean? it has a little icon for each option

6
Anonymous
Re: how to add icons to the main menu
  • 2004/3/11 23:27

  • Anonymous

  • Posts: 0

  • Since:


My solution for menu images depending on modules. Edit system_block_mainmenu.html in templates manager.

<table cellspacing="0">
  <
tr>
    <
td id="mainmenu">
      <!-- 
start module menu loop -->
      <{foreach 
item=module from=$block.modules}>
       <
class="menuMain" href="<{$xoops_url}>/modules/<{$module.directory}>/" onMouseOver="<{$module.directory}>.src='<{$xoops_url}>/modules/<{$module.directory}>/<{$module.name}>2.gif';" onMouseOut="<{$module.directory}>.src='<{$xoops_url}>/modules/<{$module.directory}>/<{$module.name}>.gif';"><img src="<{$xoops_url}>/modules/<{$module.directory}>/<{$module.name}>.gif" name="<{$module.directory}>" id="<{$module.directory}>"></a>
        <{foreach 
item=sublink from=$module.sublinks}>
          <
class="menuSub" href="<{$sublink.url}>"><img src="<{$xoops_url}>/modules/<{$module.directory}>/<{$sublink.name}>.gif"></a>
        <{/foreach}>
      <{/foreach}>
      <!-- 
end module menu loop -->
    </
td>
  </
tr>
</
table>


Only thing you have to do is making images which have the same name as in module administration and put them to their respective directories.

7
wilbury
Re: how to add icons to the main menu
  • 2004/3/12 2:27

  • wilbury

  • Just popping in

  • Posts: 13

  • Since: 2004/3/2 2


it's working but i dont know whats wrong in your code because now the menu is in blank, neither the gifs nor the text appear

8
Anonymous
Re: how to add icons to the main menu
  • 2004/3/12 6:37

  • Anonymous

  • Posts: 0

  • Since:


Strange!

Please check this (an example with module news):

1. Are the gifs called news.gif and news2.gif in the first level of the news folder?

2. Is the name of the news module in modules administration called "news"?

3. Did you make the changes for the template in the templates manager in the admin area?

4. Will changes to themes/templates be refreshed on change? To be set in administration / preferences / general settings.

Point 1 to 3 you have to repeat for every single module that will appear in the main menu. The code I provided is for images ONLY in main menu, but you can mix techniques.

Look athttp://www.florys.org as a living example.


9
wilbury
Re: how to add icons to the main menu
  • 2004/3/12 19:52

  • wilbury

  • Just popping in

  • Posts: 13

  • Since: 2004/3/2 2


i found the error on your code and now it's working! you worte "imgsrc" instead of "img src"...but there's something i dont like about this menu: i'll also have to make a special gif for every submenu. Is there a way to make an image for the module option and then let appear the classic text for the submenus? thanks

Login

Who's Online

171 user(s) are online (127 user(s) are browsing Support Forums)


Members: 0


Guests: 171


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits