Add custom icon images to left menu: Difference between revisions
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
{{howto|easy|Jorge Garifuna}} | |||
== Summary == | == Summary == | ||
Revision as of 12:35, 24 November 2007
|
ATK Howto: Add custom icon images to left menu
|
Summary
Starting from ATK 6.2 a new feature has been added to ATK by Lineke to include icon images to the left menu items. Below I intend to show how to take advantage of this new feature to beatify the left menu of ATK applications.
Requirements
ATK 6.2+
If this version is not officially released at the time of this reading, you may download the latest nightly build after November 21, 2007 from:
Implementation
1. Create theme directory within your module:
yourModule/themes/default/icons/menu
2. Create the “themedef.inc” file within the default directory so you have:
yourModule/themes/default/themedef.inc
3. Add the following code to the newly create “themedef.inc” file:
<?php
$theme["menu_icons"] = 'icons/menu/';
?>
4. Add your icons to the “menu” directory so you have:
yourModule/themes/default/icons/menu/yourModule_menuLabel.png
For example, if you had a module called “Garifuna” and a menu item with the display label “software”, your icon should be named “Garifuna_software.png” or “Garifuna_software.jpg” or “Garifuna_software.gif”. The above path would now look like:
yourModule/themes/default/icons/menu/Garifuna_software.png
From the examples above, we can see that there are three formats supported: Png Jpg Gif
5. Modify menu.tpl
Replace:
{if (count($menuitem.submenu)>0)}
{/if}
With:
{if (count($menuitem.submenu)>0)}
{/if}
The menu.tpl file is located at:
atk\themes\YourTheme\templates\menu.tpl
6. Change menu layout to “modern”
Change the following line on the config.inc.php file:
From:
$config_menu_layout = "plain";
To:
$config_menu_layout = "modern";
7. Clear the theme cache
Remove all temporary theme files from:
atktmp\themes
8. Test your icons
To test your icons, reload the left menu and if everything was done right, you should be able to see the icons next to the menu item.
Until next time,
Jorge Garifuna [2]