wayfinder printing class as content in accordion

22 views Asked by At

I had an old template and I updated MODX core and extras from 2.2 to 2.6.5. After the update the output has become very strange.

here's my code for accordion:

<li [[+wf.classes]]>
    [[+wf.classnames:contains=`livello2`:eq=`livello2`:then=`<a class="goto_scheda" title="[[+wf.pagetitle]]">[[%cat.vai_scheda? &topic=`catalogo` &namespace=`plastitalia`]]</a>`:else=``]]
    <a [[+wf.classnames:contains=`livello1`:eq=`livello1`:then=`class="link_tassonomia"`:else=``]] href="[[+wf.link]]" title="[[+wf.pagetitle]]">[[+wf.pagetitle]]</a>
    [[+wf.wrapper]]
</li>

and this is the output:

<ul class="sottomenu_catalogo">
    <li class="first livello2">
        first livello2
        <a first="" livello2="" href="/catalogo/packaging/category/product-ml-50" title="Product ml 50">Product ml 50</a>

    </li>
    <li class="livello2">
        livello2
        <a livello2="" href="/catalogo/packaging/category/product-ml-80" title="Product ml 80">Product ml 80</a>

    </li>

</ul>

Is there someone that has some idea about how to fix this?

1

There are 1 answers

0
DaFois On BEST ANSWER

I was missing the :or operator so, for some strange reason wayfinder was printing the condition as class.

<li [[+wf.classes]]>
    [[+wf.classnames:contains=`livello2`:or:eq=`livello2`:then=`<a class="goto_scheda" title="[[+wf.pagetitle]]">[[%cat.vai_scheda? &topic=`catalogo` &namespace=`plastitalia`]]</a>`:else=``]]
    <a [[+wf.classnames:contains=`livello1`:or:eq=`livello1`:then=`class="link_tassonomia"`:else=``]] href="[[+wf.link]]" title="[[+wf.pagetitle]]">[[+wf.pagetitle]]</a>
    [[+wf.wrapper]]
</li>