Magento Tips & Tricks

How To Create Vertical Navigation Menu in Magento Admin

In this article we will describe how to create vertical navigation menu in Magento admin panel. This will be helpful if you want to improve usability of admin panel by taking advantage of modern wide monitors. Or if you want to give a fresh look to custom Magento admin theme.

To turn top horizontal navigation menu into vertical one positioned at the left side we will need to add custom CSS and use some of Javascript magic.

So basically all we will need is only to include one css and some javascript file into admin panel. So will edit core xml file… (got slapped in the face) will create new custom admin theme and add it there.

We will create simple module called Verticalnav that will consist of module and config xml files and observer that will set admin theme to new custom theme called verticalnav.

/app/etc/modules/Nwdthemes_Verticalnav.xml

/app/code/community/Nwdthemes/Verticalnav/etc/config.xml

/app/code/community/Nwdthemes/Verticalnav/Controller/Observer.php

After uploading this new files to Magento and logging into admin panel you will have new custom admin theme there. Actually it will not differ from default one. Well we don’t added any design updates there yet. It is time to change it now.

Lets add local.xml file to make some design updates. Here we will add new class to body, it will be used to override styles from menu.css that can be loaded after our css file. Custom css, javascript file and jQuery will be added here too.

/app/design/adminhtml/default/verticalnav/layout/local.xml

Here goes our css file. In it we overriding css styles of horizontal navigation dropdown menu to turn it into vertical accordion navigation sidebar. It will have fixed width of 300 pixels. Same offset added to middle and footer areas to prepare space for our navigation. Later in this file you can add more styles to make this navigation even more beautiful by adding icons, hover effects etc.

/skin/adminhtml/default/verticalnav/css/verticalnav.css

OK now it looks almost like what we wanted to do. But not exactly. It stopped to act like dropdown, but not yet have accordion functionality. This will be achieved in our javascript file. Note that jQuery library is in use there with noconflict feature to avoid conflicts with Prototype.js used in Magento admin panel.

/skin/adminhtml/default/verticalnav/js/verticalnav.js

That’s it, after uploading module files and refreshing your Magento admin panel you will see vertical navigation menu. It will look like this.

Magento Admin Vertical Navigation Menu

Thank you for reading. Hope this article will be helpful to you. Sources of module created in this tutorial are available here. Also you may like to check our Wunderadmin Magento Admin Theme. Vertical navigation menu sidebar was created there in similar way.

2 thoughts on “How To Create Vertical Navigation Menu in Magento Admin

  1. Thank you for the tutorial, if possible please include snapshot of the final outcome. In that way it will be more useful for the readers. I appreciate your efforts. Thank you so much.

Leave a Reply

Your email address will not be published. Required fields are marked *