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

    I have the follwing document structure:

    german (7)
     -- doc1 (1)
     -- doc2 (2)
     ---- doc2a (3)
     ---- doc2b (4)
     ---- doc2c (5)
     -- doc3 (6)
    english (8)
     -- doc1 (9)
     -- doc2 (10)
     ---- doc2a (11)
     ---- doc2b (12)
     ---- doc2c (13)
     -- doc3 (14)
    


    I show the main menu (with submenu of the current document, if exists) on top of the page. And I want to show additionally the submenu of doc2 on any page on the left side. In a single language environment, I would just set startId=2. That would do what I want.

    But now I must set startId for the left menu according to the given language. I set the language by a TV for all documents with default value @INHERIT, so that I only need to set the language for documents 7 and 8.

    My approach was to call wayfinder like that:
    [!Wayfinder? &startId=[+phx:if=`[*sprache*]`:is=`de`:then=`4`:else`18`+] &hideSubMenus=`true`!]
    

    But this does "nothing" what means that I dont get a menu at all. Does Wayfinder support PHx in this way at all?

    Thanks for ideas
    Martin
      • 7455
      • 2,204 Posts
      you forgot the `` around the phx:
      [!Wayfinder? &startId=`[+phx:if=`[*sprache*]`:is=`de`:then=`4`:else`18`+]` &hideSubMenus=`true`!]
      


      that should work
        follow me on twitter: @dimmy01
        • 10313
        • 375 Posts
        Thanks for your quick help. But it doesnt. Thats strange. For debugging purposes, I have deleted the "!", so that I can see the wayfinder call. It reads like that:

        [!Wayfinder? &startId=`` &hideSubMenus=`true`!]
        

        I only re-added the "!". The PHx delivered an empty string. But it should at least return 18 even if the TV would not be set. Btw, I know that the TV is set correctly, because I use the same PHx call two more times in my template. Could this be the reason for my problem? I don’t think so, because bot these two calls work very fine.

        Martin

          • 10313
          • 375 Posts
          Okay, I finally got it. Dimmy: Your code works. But I had an error in the original code. It must be
          else=`18`

          I dropped the equal sign.

          Thank you
          Martin
            • 7455
            • 2,204 Posts
            ok happy that it works for you
              follow me on twitter: @dimmy01