Creating multiple side menus using Hide Category feature

Community contributions and modifications for AlegroCart
Post Reply
Bluesplayer
Posts: 152
Joined: Sun Jan 06, 2013 3:03 pm

Creating multiple side menus using Hide Category feature

Post by Bluesplayer » Sat Feb 23, 2013 11:26 am

First of all make the menu selections that you want to use in another menu active to get the paths - simply take the urls from the active links - and then make them hidden. Then add code into the appropriate place in the information.tpl (or make a new module for this) to house the new menu. Inside a directory such as '/files' or '/menus' or whatever create another directory that reflects the menu selections (such as pestmenu) inside of which should reside an index file that holds the menu selection code which will be incorporated into the information.tpl file by using ajax include (ajax include works regardless of paths whereas php include would fail to work when you move from category to sub category: ajax include).

Added code inside of information.tpl:

Code: Select all

  <div class="headingcolumn"><h1>Pet Care Categories</h1></div>
  <div id="category_menu" class="category">
  <div class="menu_breadcrumb" id="menu_breadcrumb"></div>
<script type="text/javascript">
ajaxinclude("/files/petcaremenu/index.html")
</script>
  </div>
<div class="columnBottom"></div>
Inside of the /files/petcaremenu/index.html file:

Code: Select all

  <ul>
	<li class="enabled"><a class="cat_lvl_0" href="/pest-care.html">Pest Care (2)</a></li>
	<li class="enabled"><a class="cat_lvl_0" href="/pet-care.html">Pet Care (1)<img src="catalog/styles/coloured/image/arrow.png"></a>
<ul class="menu" >
	<li class="enabled"><a class="cat_lvl_1" href="/pet-care/shampoos.html">Shampoo (1)</a></li>
</ul></li>
</ul>
The above menu (s) will have to be manually altered when adding further categorys, sub categories or products but that is no big deal.

I now have a number of new menus that make navigation a lot easier which is what I wanted :) .

Thanks to Leo / Brent for coding this very useful modification.

See below signature to see the new menus on my site.

PS: I choose the information.tpl as this is the only module I use apart from the manufacturer, category modules in my side column and it is positioned perfectly for my use. The correct way is to create a new module for your new menus which I will do soon. At least the above will set you on the right path on how to create multiple side menus - hopefully!

I have submitted this as a feature request to be coded properly:

viewtopic.php?f=14&t=861

Post Reply