I'm having problems creating a third-level navigation bar in PyroCMS, I don’t have two levels that work fine, but for some reason it won’t let me double-view the {{navigation}} array.
This is what I have:
{{ navigation:links group="header" }} {{ if children }} <li class="dropdown"> <a href="{{url}}" class="dropdown-toggle" data-toggle="dropdown">{{ title }} <b class="caret"></b></a> <ul class="dropdown-menu"> {{ children }} {{ if children }} <li class="divider"></li> <li class="nav-header">{{ title }}</li> {{ children }} <li><a href="{{url}}">{{ title }}</a></li> {{ /children }} {{ else }} <li><a href="{{url}}">{{ title }}</a></li> {{ endif }} {{ /children }} </ul> </li> {{ else }} <li {{ if class == 'current' or class == 'first current' or class == 'last current' }}class="active"{{ endif }} ><a href="{{url}}">{{ title }}</a></li> {{ endif }} {{ /navigation:links }}
I assume that “children” cannot be looped twice, if so, what is the correct way to do this work?
Thanks!
source share