We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 45980
    • 5 Posts
    Hi all.

    I’m trying to do something with Wayfinder and I’m not sure it’s possible. Hoping someone can help or point in the right direction.

    Let me try and explain.

    I’ve got a site with the tree structure below:

    Home
    About
    Maps(container)
    >>>By Location (container)
    >>>>>>Location 1(container)
    >>>>>>>>>Diabetes
    >>>>>>>>>Obesity
    >>>>>>>>>CHF
    >>>>>>>>>COPD
    >>>>>>Location 2(container)
    >>>>>>>>>Diabetes
    >>>>>>>>>Obesity
    >>>>>>>>>CHF
    >>>>>>>>>COPD
    >>>>>>Location 3(container)
    >>>>>>>>>Diabetes
    >>>>>>>>>Obesity
    >>>>>>>>>CHF
    >>>>>>>>>COPD
    >>>>>>Location 4(container)
    >>>>>>>>>Diabetes
    >>>>>>>>>Obesity
    >>>>>>>>>CHF
    >>>>>>>>>COPD
    Community
    Resources


    I have my main menu for the site working great. What I want to do is use Wayfinder to create a submenu on each of the individual pages (in the Maps area) for each of the locations for all the pages in that location.

    Example: on each of the different pages within Location 1 (2,3..etc) I have a small box that I want to list all the other pages for that location. So the diabetes page for Location 1 would list links to the Obesity, CHF, and COPD pages for Location 1. I’d also like to exclude the “current” page from that list. It's sort of a "quick pick" menu.

    I could easily do this with the startid tag and set it to the id of the appropriate folder in the tree. No problem.

    However, I’d like to do this as a chunk and have the Wayfinder call in that chunk. I’d then insert the chunk one time in the page template I’ve developed for all the “location” pages.

    So I guess what I’m asking, is it possible to tell Wayfinder to only display the items/pages at the current level and not set a specific start ID?

    That way each page would only display the pages in that location’s container, and it would change based on what page is being displayed.

    I’ve looked through the documentation and I can’t find a tag or property that would do this. If I’m missing it I apologize.

    Any help here would be greatly appreciated. Even if it’s to say, “You can’t do that.”

    Thanks in advance.

    -Justin [ed. note: jrknupp last edited this post 10 years, 4 months ago.]
      • 37042
      • 384 Posts
      Would the UltimateParent addon be your solution?
        ...
        • 22427
        • 793 Posts
        Try this Wayfinder call:
        [[!Wayfinder? &startId=`[[!UltimateParent? &topLevel=`4`]]` &selfClass=`current`]]

        You have to fiddle around with the value for &topLevel to find the correct one.

        Use a CSS class like
        .current { display: none; }
        to hide the link to the current page.
          • 30912
          • 463 Posts
          try:

          [[Wayfinder? &startId=`[[*parent]]` &excludeDocs=`[[*id]]` ]]


          bear in mind, if your current is a folder it will hide the sub items as well, so on your 'location' page you might want to have the call to not exclude the id (or it wont list the sub items) so your 'location' page template will need a different call to not exlcude the ID.

          Should work smiley

          Might have to faff with the cached and uncached call though.

          On a side note, you might also have trouble with aliases for the pages unless you have URL path turned on so unless you are using the structure for URLs as

          by-location/location-1/obesity
          by-location/location-2/obesity
          by-location/location-3/obesity

          etc

          edit (again):

          if yours location tempalte and sub page template is the same, you cna utilise If to display different content. (NOT TESTED btw its from memory)

          [[If? 
          &subject=`[[*isfolder]]` 
          &operator=`EQ` 
          &operator=`1` 
          &then=`[[Wayfinder? &startId=`[[*id]]`]]` 
          &else=`[[Wayfinder? &startId=`[[*parent]]` &excludeDocs=`[[*id]]`]]`
          ]]


          This obviously needs IF installed but essentially checks if the current is a container, if it is then display elements starting from itself, if it isnt a container then display itesm from the parent. [ed. note: Tyreal2012 last edited this post 10 years, 4 months ago.]
            • 45980
            • 5 Posts
            Hi all.

            I knew there had to be a way to do it.

            They all work. Need to play around to see which one I'll go with, but I really appreciate the help.

            Thanks a ton! Really appreciate the help.

            -Justin