We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21417
    • 486 Posts
    Hello,

    I am wanting to run wayfinder for a menu with 7 top level links and 2 sub level links but for the life of me I can’t get it to work.

    eg. Say the site structure is as follows... :
    + home (1)
    + product (2)
     - small (16)
     - big (17)
    + shapes (3)
    + colours (4)
     - one (14)
     - two (15)
    + about (5)
    + terms (6)
    + contact (7)
    + why (8)
    


    ... And I want to include these 9 documents... :
    + product (2)
    + shapes (3)
    + colours (4)
     - one (14)
     - two (15)
    + about (5)
    + terms (6)
    + contact (7)
    + why (8)
    


    ... all as top level items (ie not as nested lists):
    + product (2)
    + shapes (3)
    + colours (4)
    + one (14)
    + two (15)
    + about (5)
    + terms (6)
    + contact (7)
    + why (8)
    
    eg
    <ul>
     <li>product</li>
     <li>shapes</li>
     <li>colours</li>
     <li>one</li>
     <li>two</li>
     <li>about</li>
     <li>terms</li>
     <li>contact</li>
     <li>why</li>
    </ul>
    


    How do I run that in wayfinder?

    For some reason the menu I am outputing features only the seven top level items - not the two second level items (docs 14 and 15)

    I am absolutely stumped and need the help of an expert.

    Existing Wayfinder call =
    [[Wayfinder? &startId=`0` &level=`0` &titleOfLinks=`menutitle` &outerTpl=`imagemenu-outerwrapper` &parentRowTpl=`imagemenu-row` &innerTpl=`imagemenu-innerwrapper` &rowTpl=`imagemenu-row` &includeDocs=`2,3,4,14,15,5,6,7,8`]]
    


    &outerTpl=`imagemenu-outerwrapper` =
    <div class="imgnav">
     <ul>
      [+wf.wrapper+]
     </ul>
     <div class="clear"></div> 
    </div>
    


    &parentRowTpl=`imagemenu-row` + &rowTpl=`imagemenu-row =
    <li><a href="[+wf.link+]" title="[+wf.title+]" class="th2">[+imagemenu-photo+]<span>[+imagemenu-text+]</span></a></li>
    


    &innerTpl=`imagemenu-innerwrapper` =
    [+wf.wrapper+]
    


    What am I missing?

    Thanks in advance.
      Web design Adelaide
      http://gocreate.com.au
      • 21417
      • 486 Posts
      just pushing to the top of the list...
        Web design Adelaide
        http://gocreate.com.au
        • 22427
        • 793 Posts
        Hi nickf08,

        the parameter &includeDocs is meant to force documents to show in the menu which for some reason otherwise remain invisible (f.i. because their "show in menu" option is unchecked).
        So in your case, &includeDocs=`2,3,4,14,15,5,6,7,8` has no effect at all, given that all these documents are visible anyway.
        So better exclude the not wanted documents: &excludeDocs=`1,16,17` should do what you intend.

        Kind regards
        ottogal

          • 26931
          • 2,314 Posts
          hey nick,

          not 100% sure what you want to achieve... smiley
          the submenu items of "colours should be displayed as topmenu items ( and not being nested with an additional ul )?
            • 22427
            • 793 Posts
            Because Wayfinder is reflecting the tree structure of the documents, the nesting will be reproduced in its output (I think). May be there is a way to use special css styling (making inline elements out of the <li>s - I’m just guessing...)
              • 22427
              • 793 Posts
              Another option: Use Ditto instead of Wayfinder.

              Try a ditto call like this:
              [!Ditto? &documents=`2,3,4,14,15,5,6,7,8` &tpl=`dittomenutpl` &sortBy=`menuindex` &sortDir=`ASC` !]

              using this chunk dittomenutpl:
              <a href="[~[+id+]~]">[+pagetitle+]   </a>

              (You can achieve the wanted order of the output setting the menuindexes in the proper way, ignoring the level in the tree.)
              The rest is CSS (of course you avoid the "&nbsp;").

              ottogal
                • 21417
                • 486 Posts
                Hello Sharkbait and Ottogal,

                Thanks for the input.

                For some reason only the 7 top level items are included in the current menu output - with or without include vs exclude - "include" would be the better option because there are about 70 pages on the site and new ones to be created so it would be a nightmare to maintain.

                I think it has something to do with the row templates I am using / calling...

                Removing both row templates - this displays the correct 9 but without the formatting / images / text (which comes from template variables)...
                [[Wayfinder? &startId=`0` &level=`0` &outerTpl=`imagemenu-outerwrapper` &innerTpl=`imagemenu-innerwrapper` &includeDocs=`2,3,4,14,15,5,6,7,8`]]
                


                Adding only &parentRowTpl - this displays 7 boxes with only one correctly formatted (its the parent of the 2 sub pages) with the tv image / text...
                [[Wayfinder? &startId=`0` &level=`0` &outerTpl=`imagemenu-outerwrapper` &parentRowTpl=`imagemenu-row` &innerTpl=`imagemenu-innerwrapper` &includeDocs=`2,3,4,14,15,5,6,7,8`]]


                Adding only &rowTpl - this displays 7 boxes with all correctly formatted - but only the 7 top level links are included...
                this displays the 7 top level only with the template variables with no inclusion of the sub levels...
                [[Wayfinder? &startId=`0` &level=`0` &outerTpl=`imagemenu-outerwrapper` &rowTpl=`imagemenu-row` &innerTpl=`imagemenu-innerwrapper` &includeDocs=`2,3,4,14,15,5,6,7,8`]]


                Adding &parentRowTpl and &rowTpl - Back to where I started at - this displays 7 boxes with all correctly formatted - but only the 7 top level links are included...
                [[Wayfinder? &startId=`0` &level=`0` &outerTpl=`imagemenu-outerwrapper` &parentRowTpl=`imagemenu-row` &innerTpl=`imagemenu-innerwrapper` &rowTpl=`imagemenu-row`  &includeDocs=`2,3,4,14,15,5,6,7,8`]]


                What am I missing?

                Your post landed while I was writing this Ottogal - will try Ditto...
                  Web design Adelaide
                  http://gocreate.com.au
                  • 21417
                  • 486 Posts
                  Hey Ottogal,

                  Wow - Thanks - Ditto has done the trick!

                  [!Ditto? &documents=`2,3,4,14,15,5,6,7,8` &tpl=`imagemenu-ss-row` &sortDir=`ASC` !]


                  The Ditto call puts them in the order: 2,3,4,5,6,7,8,14,15.

                  Is it possible to put them in a custom order like so 2,3,4,14,15,5,6,7,8?

                  Many thanks again!
                    Web design Adelaide
                    http://gocreate.com.au
                    • 22427
                    • 793 Posts
                    What I meant above: You could "abuse" the menuindex which normally is used for ordering documents within the same level.
                    Let’s assume, your documents have the following menuindexes:
                    home           0
                    product        1
                        small          0 
                        big            1
                    shapes         2
                    colours        3
                        one            0
                        two            1
                    about          4
                    terms          5
                    contact        6
                    why            7
                    

                    Then just change this to the following:
                    home           0
                    product        5
                        small          10 
                        big            15
                    shapes        20
                    colours       25
                       one             30
                       two             35
                    about         40
                    terms         45
                    contact       50
                    why           55
                    

                    (Note that the menuindex must not be incremented by 1. If you make bigger steps you can more easily insert a new document later.)
                    Maybe there is a much cleverer way to achieve the order.

                    Glad it worked so far
                    ottogal


                      • 21417
                      • 486 Posts
                      Thanks Ottogal - ah, now I see what you mean.

                      That method will work but might get a little tricky to maintain as the site grows (the client will be maintaining it).

                      I have posted in the ditto section re the custom sort order:

                      http://modxcms.com/forums/index.php/topic,43076.0.html

                      Thanks again for your wonderful help.

                      All the best
                        Web design Adelaide
                        http://gocreate.com.au