• Splitting Wayfinder menu in middle and adding logo there#

  • fbasta Reply #1, 5 months, 4 weeks ago

    Reply
    Hi, is there any way to add a different row (in my case its h1 with logo) in the middle of my menu.... the design i m working on has the logo like this, and i m little lost. I was thinking about writing two wayfinder calls using list of resource ids. If there is some other "more elegant" solution, would love to know.

    Thanks


  • ottogal Reply #2, 5 months, 4 weeks ago

    Reply
    You could use the parameter &rowIdPrefix to specify a unique ID for each row. Then you write a chunk for the &rowTpl parameter wherein you can let modifiers decide about the output of the extra h1 element, dependent on the value of the row's ID.


  • fbasta Reply #3, 5 months, 2 weeks ago

    Reply
    Hi, thanks for answer, well i tried to do it with modifiers, but i couldnt find out how. Tried to find some tutorials on modifiers, but only found the description in modx manual. Can you please help me to get it work.... I guess i m messing it up, I tried

    [[+wf.id :if=`[[+wf.id]]` :eq=`id-of-li-after-which-i-want-li-with-h1` :then=`<li><h1>Text</h1></li>` :else=`<li [[+wf.classes]] [[+wf.id]]><a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]><span>[[+wf.linktext]]</span></a>[[+wf.wrapper]]</li>`]] 


    I guess its completely wrong, and i tried some modifications, but without any succes.
    Thanks in advance.


  • ottogal Reply #4, 5 months, 2 weeks ago

    Reply
    Try this chunk for your &rowTpl:
    [[+wf.id:eq=`id-of-li-*before*-which-i-want-li-with-h1`:then=`<li><h1>Text</h1></li>`]]
    <li [[+wf.classes]] [[+wf.id]]>
    <a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]><span>[[+wf.linktext]]</span></a>[[+wf.wrapper]]</li>


  • fbasta Reply #5, 5 months, 2 weeks ago

    Reply
    Thanks again, well i tried exactly what you posted, but nothing happend, the list is displayed normaly, but no sign of h1 in generated code. I m quite lost


  • ottogal Reply #6, 5 months, 1 week ago

    Reply
    Sorry, I was misleading you.

    If you take &rowIdPrefix=`item-` the value of the placeholder [[+wf.id]] will be
    id="item-42"
    for the resource with id 42.
    So the modifier in the &rowTpl chunk should be
    [[+wf.id:eq=`id="item-42"`:then=`<li><h1>Text</h1></li>`]]
    if the resource you want the headline before has id 42.

    But now I see you can make it easier, there is no need of &rowIdPrefix at all:
    Just use [[+id]] instead of [[+wf.id]]:
    [[+id:eq=`42`:then=`<li><h1>Text</h1></li>`]]



  • fbasta Reply #7, 5 months, 1 week ago

    Reply
    Thanks a lot, that worked like a charm. Again i m little bit smarter.