We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29201
    • 239 Posts
    Ok --- visual first....I’d like to get Wayfinder to display my navigation like this:

    http://cl.ly/e78680d65ac30804229f

    however I’m stuck with it looking like this:

    http://cl.ly/2b9e79edc1271af5882b

    You’ll notice that any parent element that doesn’t have children doesn’t get the proper styling. Here’s what I have in my Wayfinder call:

    [[Wayfinder? &startId=`0` &level=`3` &parentRowTpl=`cssplay_parentRow` &outerTpl=`cssplay_outer` &innerTpl=`cssplay_inner` &rowTpl=`cssplay_row`]]

    this is loosely based on the dropdown menu presented here (http://muddydogpaws.com/development/wayfinder/examples/example-1.html).

    Chunks are as follows:
    1. cssplay_parentRow:

    <li><div class="equaliser fade-orange"></div><a class="parent-level" href="[+wf.link+]"><span class="title">[+wf.title+]</span><span class="subtitle">todo ambiente</span></a>
        [+wf.wrapper+]
    </li>
    
    


    2. cssplay_outer:
        <ul id="menu"> 
            [+wf.wrapper+]
        </ul>
    <a href="#" id="navigation-rss"><span class="rss-fade" style="opacity: 0; display: block;"></span></a>
    


    3. cssplay_inner:
    <ul class="sub">
        [+wf.wrapper+]
    </ul>


    4. cssplay_row:
    <li><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>[+wf.wrapper+]</li>
    


    Can anyone spot my oversight???
    huh
    Thanks!
      • 15987
      • 786 Posts
      Since your top level documents don’t all have children you need to make a couple changes. change your cssplay_row chunk to match cssplay_parentRow.

      Then create a new chunk for use with the parameter &innerRowTpl and make it use what you have for the cssplay_row chunk.

      This should do what you want.
        • 29201
        • 239 Posts
        kyleej,

        thank you. this is exactly what i needed!

        i’ve updated my Wayfinder call to this:

        [!Wayfinder? &startId=`0` &level=`3` &parentRowTpl=`cssplay_parentRow` &outerTpl=`cssplay_outer` &innerTpl=`cssplay_inner` &rowTpl=`cssplay_parentRow`&&innerRowTpl=`cssplay_row`!]


        and it works!

        The only issue I have now is I’d like to pull in the value for the ’link_attributes’ field in the cssplay_parentRow Chunk so it displays just below the menu title.

        This is what I have for cssplay_parentRow:

        <li><div class="equaliser fade-orange"></div><a class="parent-level" href="[+wf.link+]"><span class="title">[+wf.title+]</span><span class="subtitle">[*link_attributes*]</span></a>
            [+wf.wrapper+]
        </li>
        


        ....but this gives me the value for the page that I’m on therefore it is repeated under each menu title as you can see here:

        http://cl.ly/8292a77ea521c7d76e0b

        Is this a cache setting? I’ve played with cache on the Wayfinder call as well as the page to no avail.

        Again kyleej Thanks!!!!
          • 15987
          • 786 Posts
          use this placeholder for the link attributes:

          [+wf.attributes+]
            • 29201
            • 239 Posts
            kyle,

            YES! Thank you again. I actually got this working using the getField snippet but I think you’re suggestion is much more succinct and perhaps won’t have to worry about future compatibility with upgrades....regardless really appreciate your help.

            you rock man!
              • 15987
              • 786 Posts
              Glad its working. I would use the way I posted since using getField will run an additional query for each item in the menu.
                • 29201
                • 239 Posts
                Quote from: kylej at Sep 28, 2010, 10:31 AM

                use this placeholder for the link attributes:

                [+wf.attributes+]

                why isn’t this [+link_attributes+]?

                I thought was the field name according to ManagerManager documentation??
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  It just isn’t. The field name in the form is link_attributes, and the fieldname in the database is link_attributes, but Wayfinder assigns any values in the database field to the wf.attributes placeholder. That’s what documentation is for. So you can determine exactly what parameters and placeholders are available without guessing.
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                    • 29201
                    • 239 Posts
                    got it now by viewing the Wiki here: http://cl.ly/7736be03241b1638a4e3

                    my confusion was a result of viewing the ManagerManger documentation for field names as seen here: http://cl.ly/e7f5335e93e3b8463821

                    thanks Susan!
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      Indeed, I almost always have my handy-dandy Wayfinder and Ditto cheatsheets open whenever I’m building a site.


                      http://modxcms.com/forums/index.php/topic,42600.msg255098.html#msg255098
                        Studying MODX in the desert - http://sottwell.com
                        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                        Join the Slack Community - http://modx.org