edit auto nav block to make it output differently

Permalink
Hi all

I need to make the C5 auto nav work with this nav menu:
http://jsfiddle.net/dXB37/4/

Please can you help?

I am actually still working on this jsfiddle. When you get to a sub menu <ul> the centre part is laying over the links making the links not click-able - but i might be able to fix this!

I was hoping that some one here might help me with making this menu work with C5.

This menu doest have embedded <ul> tags

eg:
<ul>
<li><a href="">
<ul>
<li><a></li>
</ul>
</li>
</ul>

This menu just has <ul> aftet </ul> after </ul> not embedded with in <li> tags.

So i was hoping some one here might know how to make C5 out put its sub and sub sub menus as individual unordered lists?

e.g:
for each sub menus

output the children as a new ul

then if the children have children output these as another <ul>

chris123uk
 
goldhat replied on at Permalink Best Answer Reply
You'll need to create a custom Block Template for autonav to output the links the way you want. Autonav comes with 2 templates in addition to its default view. You can copy any of them from /concrete/blocks/autonav/. I'm going to suggest you copy header_menu.php, so you'll find that at /concrete/blocks/autonav/templates/header_menu.php. Put your copy of that file into your own blocks directory at /blocks/autonav/templates/. You can rename it, maybe name it "circle_menu.php". Now after doing this you should be able to see the new template listed as Circle Menu under the templates list for your autonav block.

I don't know how comfortable you are with PHP, but inside that file you will see that all the navigation items are brought in with:

$navItems = $controller->getNavItems();


Now normally the way the menu is output in any of the default template is in a single loop. So in that 1 loop all the levels are output. It sounds like what you need to do is output only the top level in the first loop. Then you need to create another loop through the original $navItems and output only subnav items. If you do this correctly you can create the multiple <ul> lists and output the names you need.

This is achievable but it will take a bit of work. If you can get the templates started and get some progress on the loops... post back here if you get stuck.
chris123uk replied on at Permalink Reply
chris123uk
i decided i would have more problems making this work with individual UL tags so i have remade the menu to work with embedded ul tags so i dont have to mess too much with the autonav block.

http://jsfiddle.net/ZN2dH/9/
just trying to figure out the jquery bit to make the menu to show / hiding each level with a way of getting back to previous levels.