We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32645
    • 377 Posts
    I have a primary menu navigation which lists pages as menu links. I also require Wayfinder to look inside a folder called "Featured Projects" (which is not shown in the menu) and pull out its children (only 1 level deep) and include them in my primary menu.

    So, my page structure is like this;

    a) Home
    b) About
    c) Featured Projects
    i) Project 1
    ii) Project 2
    iii) Project 3
    d) Contact

    And my primary menu is to look like this;

    Home | About | Project 1 | Project 2 | Project 3 | Contact

    I have the following WF call;

    [[Wayfinder? &startId=`0` &level=`2` &sortBy=`menuindex`  &sortDir=`ASC` &total=`0` &ignoreHidden=`true` &hereClass=`current`]]
    


    WF outputs the list as multiple HTML lists, but I only want 1 flat HTML list, not many, as per my diagram.

    So, how do I make WF:

    1. Get all documents, and all children of all folders (unless it appears in my &excludeDocs list)
    2. Do not display any folders/containers, but still show its children in one flat HTML list.
    3. Echo out the flat HTML list.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Then don’t use lists in your chunk templates.

      If you really must have it as a list, use the parameters and the templates to not show the parent, and fiddle the templates to not have any inner <ul> </ul> tags.
        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
        • 32645
        • 377 Posts
        Unfortuently they do have to be inline (its not a pipe-list, I only used that as a visual example).

        When you say you can tell the "chunk templates to not show the parent" -- how do you do this?

        Thanks.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          I’ve made menus with <span> elements, display: block; float: left to get them to line up in a container. I know there’s a display directive of inline-block, but I’ve never used it; I’m not sure how different browsers handle it.

          I’ve also used multiple Wayfinder calls, all styled so you can’t tell where one left off and the other started.

          You could even use a table, with each link in its own <td> element.

          &parentRowTpl, or &categoryFoldersTpl - this template could be empty. See the document that can be downloaded from the Wiki entry for Wayfinder200 for more details.

          All you want is a horizontal row of links. There’s probably a dozen ways to get that.
            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
            • 32645
            • 377 Posts
            The presentation issue isn’t really a problem, as I can easily rectify that - the issue for me is the display of a container/folder page which I don’t want to appear at all, but this should not affect any child pages I try to retrieve.

            I’m going to try leaving &parentRowTpl and &categoryFoldersTpl empty in seperate tests to see if it hides the container, without sacrificing the child pages.

            I also like the idea of multiple WF calls, having one for the primary menu (highest in the tree) then another just for the container. Because startID = containerID, this would mean not showing the container.

            Of course I could try a template variable, but ideally I’d like to do it without even using that, as it would not be a future-proof against new folders/containers.

            I think if &parentRowTpl, or &categoryFoldersTpl do not work, I will probably go with multiple WF calls.