WebsiteBaker Support (2.8.x) > Templates, Menus & Design

Menu to display as images

(1/1)

daydreamer:
If my menu has, Home, About Us, Contact Us
How would I set them to display as images?

chio:
the easiest way is to hardcode them in your Template.

crnogorac081:
Hi,

This is solution for your menu which I used:


--- Code: ---<?php show_menu(1, 0, 1, true, "[a]<img src=" .WB_URL ."/media/flags/[menu_title].gif />[/a]", &#39;&#39;, &#39;&#39;, &#39;&#39;, false, &#39;&#39;, 0); ?>

--- End code ---

I used this to show flag images for EN and local language.

So you can use something like this:


--- Code: ---<?php show_menu(1, 0, 1, true, "[a]<img src=" .WB_URL ."/media/menu_images/[menu_title].gif />[/a]", &#39;&#39;, &#39;&#39;, &#39;&#39;, false, &#39;&#39;, 0); ?>

--- End code ---

As you can see, the most important part is
--- Code: --- "[a]<img src=" .WB_URL ."/media/menu_images/[menu_title].gif />[/a]" 
--- End code ---
which calls the image, so I think that you can use
--- Code: --- "[a]<img src=" .TEMPLATE_DIR. "/menu_images/[menu_title].gif />[/a]"
--- End code ---
and store the images in the template folder in folder menu_images and there put the images with names same as manu title...

I hope I helped you...When you finish post the link to see :))

cheers

daydreamer:
Many thanks I will give this a go looks straight forward, I sure will post link when I done but a good few weeks away at the moment.

Also is there anyway to also add seprate image for hover state

Thanks Again

crnogorac081:
Unfortunatelly i did't need that, as I used images just for flags...Maybe someone else have idea for hover ??

Navigation

[0] Message Index

Go to full version