Sandy
I'm new here

header Funktion Navigation Abfrage nach children

Jump to solution

Hallo zusammen,

habe folgende header Funktion, welche zur Ausgabe der Navigation dient.

Darin soll die Stylesheet-Klasse 'hasChildren' nur dann gesetzt werden, wenn der aktuelle Menüpunkt noch Unterknoten hat.

Hat jemand eine Idee, wie man das abfragen könnte ?

<CMS_FUNCTION name="Navigation" resultname="fr_mainnavigation">

        <CMS_PARAM name="expansionVisibility" value="standard"/>

        <CMS_PARAM name="wholePathSelected" value="1"/>

        <CMS_PARAM name="menuFirst" value="1" />

        <CMS_PARAM name="root" value="pagefolder:mess_ka" />

       

       

        <CMS_ARRAY_PARAM name="unselectedHTML">

            <CMS_ARRAY_ELEMENT index="1..2">

                <![CDATA[

               

                            <ul class="$CMS_IF(#nav.level == 1)$secondArea$CMS_ELSIF(#nav.level == 2)$thirdArea$CMS_END_IF$">

                                <li><a href="$CMS_REF(#nav.ref)$" title="$CMS_VALUE(#nav.label)$">$CMS_VALUE(#nav.label)$$--,$CMS_VALUE(#global.node.getChildren().toList().size())$, $CMS_VALUE(#nav.positions.size)$, $CMS_VALUE(#nav.level)$--$</a>

               

               

                ]]>

            </CMS_ARRAY_ELEMENT>

            <CMS_ARRAY_ELEMENT index="0">

                <![CDATA[

               

                    <li><a href="$CMS_REF(#nav.ref)$" title="$CMS_VALUE(#nav.label)$">$CMS_VALUE(#nav.label)$$--,$CMS_VALUE(#global.node.getChildren().toList().size())$, $CMS_VALUE(#nav.positions.size)$, $CMS_VALUE(#nav.level)$--$</a>

               

                ]]>

               

            </CMS_ARRAY_ELEMENT>

        </CMS_ARRAY_PARAM>

               

        <CMS_ARRAY_PARAM name="selectedHTML">

            <CMS_ARRAY_ELEMENT index="1..2">

                <![CDATA[

               

                            <ul class="$CMS_IF(#nav.level == 1)$secondArea$CMS_ELSIF(#nav.level == 2)$thirdArea$CMS_END_IF$">

                                <li>

                                    <a class="

                                        $CMS_IF(#nav.node.depth > 3)$

                                           

                                            hasChildren

                                           

                                        $CMS_END_IF$

                                            active

                                    " href="$CMS_REF(#nav.ref)$" title="$CMS_VALUE(#nav.label)$">$CMS_VALUE(#nav.label)$$--,$CMS_VALUE(#global.node.getChildren().toList().size())$, $CMS_VALUE(#nav.positions.size)$, $CMS_VALUE(#nav.level)$--$</a>

               

                ]]>

            </CMS_ARRAY_ELEMENT>

            <CMS_ARRAY_ELEMENT index="0">

                <![CDATA[

                   

                    <li>

                        <a class="

                            $CMS_IF(#nav.node.depth > 3)$

                               

                                hasChildren

                               

                            $CMS_END_IF$

                                active

                            $CMS_IF(#nav.selected == true)$

                                currentItem

                            $CMS_END_IF$

                        " href="$CMS_REF(#nav.ref)$" title="$CMS_VALUE(#nav.label)$">$CMS_VALUE(#nav.label)$$--,$CMS_VALUE(#global.node.getChildren().toList().size())$, $CMS_VALUE(#nav.positions.size)$, $CMS_VALUE(#nav.level)$--$</a>

               

                ]]>

            </CMS_ARRAY_ELEMENT>

        </CMS_ARRAY_PARAM>   

       

        <CMS_ARRAY_PARAM name="endHTML">

            <CMS_ARRAY_ELEMENT index="1..2">

                <![CDATA[

                            </li>

                        </ul>

                ]]>

            </CMS_ARRAY_ELEMENT>

            <CMS_ARRAY_ELEMENT index="0">

                <![CDATA[

                    </li>

                ]]>

            </CMS_ARRAY_ELEMENT>

        </CMS_ARRAY_PARAM>

   

       

    </CMS_FUNCTION>

Freundliche Grüße,

Sandra Stolle

0 Kudos
1 Solution

Accepted Solutions
hoebbel
Crownpeak employee

Hallo Sandra,

einfach mittels #nav.hasSubFolders prüfen, ob der Knoten Kinder hat oder nicht. Die Doku gibt es hier:

ODFS

User: FIRSTDoku

Pass: FSdown_V2

Viele Grüsse aus Dortmund,

  Holger

View solution in original post

0 Kudos
1 Reply
hoebbel
Crownpeak employee

Hallo Sandra,

einfach mittels #nav.hasSubFolders prüfen, ob der Knoten Kinder hat oder nicht. Die Doku gibt es hier:

ODFS

User: FIRSTDoku

Pass: FSdown_V2

Viele Grüsse aus Dortmund,

  Holger

0 Kudos