custom autonav template

Permalink 1 user found helpful
Hi I hav a static site that needs to be converted to c5. Simple job :).
Only problem I am having is to create a autonav template to my needs. My static structure looks like this :
<ul id="mainnav">
<li>
<div class="menu"><a href="inhalt/unternehmen/unternehmen.html">Unternehmen</a></div>
</li>
<li>
<div class="menu"><a href="inhalt/produkte/produkte.html">Produkte</a></div>
</li>
<li>
<div class="menu"><a href="inhalt/service/pruefservice.html">Service</a></div>
<ul>
<li style="margin-top: 10px;"><a href="inhalt/service/produktkatalog.html">Produktkatalog</a></li>
<li><a href="inhalt/service/pruefservice.html">Prüfservice</a></li>
<li><a href="inhalt/service/seminare.html">Seminare</a></li>
<li style="margin: 0;"> </li>
</ul>


So simply created a new template under the blocks folder and changed the view.php.
Now all links are enclosed in a div.

What I need is that only the links on the top level are enclosed in a div and all sub menu links are not.
Thx for ur help.

View Replies:
jero replied on at Permalink Reply
jero
First of all, I'd strongly recommend using JordanLev's autonav template:http://c5blog.jordanlev.com/blog/2011/12/customizing-the-autonav-te...

If you use that template, then if you look at the end of foreach loop at the end of teh file, judicious use of $ni->hasSubmenu() and $ni->subDepth() ought to get you what you want
plagil replied on at Permalink Reply
Thx that saved the day :)
hrcv replied on at Permalink Reply
hrcv
You save my day! Thanks for this!