En:Use of images in menus
From phpCMS
Question: How can I use images instead of text links as menu items?
Answer: In the menu file you can define additional fields as you like. Just define a new field, e.g. named "GIF" and use it to insert the path to the image that should be used for this menu item.
Example:
In the menu file (.mnu) a block with an additional column "GIF" could look like this:
MENU: MAIN CLASS; MNAME; LINK; TEXT; GIF 00.01; Homepage; $home/index.htm; To homepage; $home/images/home.gif 00.02; Page1; $home/page_1.en.htm; To page 1; $home/images/page1.gif 00.03; Page2; $home/page_2.en.htm; To page 2; $home/images/page2.gif 00.04; Page3; $home/page_3.en.htm; To page 3: License; $home/images/page3.gif 00.05; Search; $home/search.en.htm; To search facility; $home/images/search.gif 00.06; Sitemap; $home/sitemap.en.htm; To sitemap; $home/images/sitemap.gif
In the menu template (.mtpl), which describes the layout of the menu, you then have to tell phpCMS that it should use that image.
Without image, i.e. with text link only, the relevant line in the menu template could have looked like this:
{MAIN.NORMAL}
<a href="{LINK}">{MNAME}</a>
If you now want to have an image instead of the text link, that same line could look like this:
{MAIN.NORMAL}
<a href="{LINK}"><img src="{GIF}" border="0" /></a>
That means that in the menu file you define all the data that phpCMS should know about for each menu item, and in the menu template you define how these data should be displayed.
Based on an answer (in German) by Ignatius in the phpCMS support forum.
Diese Seite in anderen Sprachen: Deutsch
Main Page: FAQ MainPage | Top Page: English FAQ MainPage

