質問

I am having some trouble making a third level navigation bar in PyroCMS, I have not two levels working fine but for some reason it won't let me look through the {{ navigation }} array twice.

This is what I currently 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 am guessing "children" cannot be looped twice, if so what is the correct way to make this work?

Thanks!

役に立ちましたか?

解決

After sometime I found out that you can use the following lex tag:

{{ *recursive children* }}

But you cannot customize the look by using this tag. And you cannot use the children look within a child loop.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top