We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36672
    • 2 Posts
    Hi - I am new to both Revo and Wayfinder. Many thanks to all have contributed to making it what it is. The docs are a lot to get one's head around and the 147 page guide to wayfinder in particular is splendid, exhaustive but - well - just a little exhausting...

    Briefly, I want to use one template for both containers and their content pages, and have all the menu items for content pages in a container appear both when the container is displayed and also when any of the content pages are displayed.

    so if I have a container foo, with contents bah, hum and bug

    when I click on foo I want to see a menu containing bah, hum and bug
    and when I click on bah I want to see a menu containing bah, hum and bug (plus foo, but the displayStart takes care of that...)

    I can hack this up by creating separate templates for containers and contents, and issuing

    [[!Wayfinder?  &displayStart=`TRUE` &fullLink=`TRUE`]] 


    in the containers template and...

    [[!Wayfinder? &level=`2` &startId=`[[*parent]]` &displayStart=`TRUE` &fullLink=`TRUE`]]


    in the contents template.

    But it is not terribly elegant. I would prefer to use one template.

    Is there a way to issue wayfinder calls conditionally, depending on the "level" one is in?

    I.e if one knows that ones container is always at a set "level" in the hierarchy, how does one test for it and do the appropriate way finder call?

    Even better, is there a simple way of telling Wayfinder to do what I want with a single call?

    Many thanks to anyone who has the time and expertise to answer. [ed. note: nickmay last edited this post 15 years, 1 month ago.]
      • 32316
      • 387 Posts
      whistlemaker Reply #2, 15 years ago
      Perhaps you could use the "If" snippet to call different wayfinder calls depending on some resource parameter - could be 'is folder' or if parent is '0' depends on your site structure.

      Or...

      Could be possible to do with just css rules - depends on the details you do not mention above - using classes for active (parent and child will get active class) and self to show and hide links as needed.

      Hope that points you in some useful direction.

      I was not clear whether there were multiple foos ( foo, foo1, foo2, etc) or whether bah, hum, etc might have children, and how foo1 fits into the menu system and so on... ... so my reply is very generic
        • 36672
        • 2 Posts
        The If snippet - great - many thanks. This works fine.

        [[!If?
           &subject=`[[*isfolder]]`
           &operator=`EQ`
           &operand=`1`
           &then=`[[$sideMenuWayfinder_container]]`
           &else=`[[$sideMenuWayfinder_internal]]`
        ]]
        
          • 32316
          • 387 Posts
          whistlemaker Reply #4, 15 years ago
          many thanks
          you're welcome