How to add classes and html to Auto Nav?

Permalink
I want to modify Auto-Nav so that it works with Foundation 4 topbar navigation. So i have to add some class=right to <ul> and additional <li class=divider> elements.

Which is the proper way to do this? Do i have to build a new block for this or is there an easier way?

 
JohntheFish replied on at Permalink Reply
JohntheFish
You need to create a new view template, as per
http://www.concrete5.org/documentation/how-tos/designers/change-how...

Create a copy of the core autonav view.php in site_root/blocks/autonav/view.php

If you want to add a custom css file for just this template, create view.css in the same folder.

Then edit the code that outputs the nested lists. There are detailed comments in the file.

Then in the global header area where the autonav block resides, select the new block template you have created.

Another howto that contains related info is
http://www.concrete5.org/documentation/how-tos/developers/change-th...
pixeltobi replied on at Permalink Reply
..thanks, will look into it
jvansanten replied on at Permalink Reply
Jordan Lev rewrote the AutoNav template to make it much easier to modify -- as well as adding several other features.

I'd heard rumors that this would be included in the core product, and it may be so at this point.

In any case, here's his take on his modified template -- this will give you some good guidance as to either incorporating this in your site, or using it effectively.

http://c5blog.jordanlev.com/blog/2011/12/customizing-the-autonav-te...