We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22427
    • 793 Posts
    <li[+wf.classes+]>
        <a href="[+wf.link+]">[+wf.linktext+]</a>
        [+phx:if=`[+wf.id+]`:is=`ID_ABOUT_US_PAGE_HERE`:then=``:else=`[+wf.wrapper+]`+]
    </li>
    Here the then and else parts should be switched, shouldn't they?

    I am not sure if you need [+wf.id+] or [+id+] there
    Neither of them: You need [+wf.docid+]


    I would do it like this:
    <li[+wf.classes+]>
        [+phx:if=`[+wf.docid+]`:is=`ID_ABOUT_US_PAGE_HERE`:then=`
    	        [+wf.linktext+][+wf.wrapper+]
    	`:else=`
    	        <a href="[+wf.link+]">[+wf.linktext+]</a>
        `+]
    </li>
      • 19369
      • 1,098 Posts
      Quote from: ottogal at Jun 08, 2012, 11:28 PM
      Here the then and else parts should be switched, shouldn't they?

      Oops! You're right!
        • 40024
        • 72 Posts
        I didn't even have phx installed :O . Well,i tried that,and now i get a strange output in my menu.The menu exists, but it is messed up. It is like the parser sees the code and outputs the words as they are, not as they should be.For example it says(after i click preview):

         `:is=`60`:then=`Home`:else=`[url]Home[/url]`+]


        That is what i wrote in the chunk for the &rowTpl parameter.

        <li[+wf.classes+]>[+phx:if=`[+docid+]`:is=`60`:then=`[+wf.linktext+][+wf.wrapper+]`:else=`<a href="[+wf.link+]">[+wf.linktext+]</a>`+]</li>


        I also tried it with [+wf.id+] and [+id+] but still nothing.60 is the id of the resource "About Us"
          • 40024
          • 72 Posts
          Oups! I meant this is the output of my menu :
          `:is=`60`:then=`Home`:else=`Home`+]


          where the "Home" inside the else part,is a menu item. This output is the same for all my other menu items.
            • 19369
            • 1,098 Posts
            I have just tried the code of @Ottogal, it is working perfectly. Make sure that you have "OnParseDocument" checked in the PHx plugin.
              • 19369
              • 1,098 Posts
              Quote from: dinpapa at Jun 10, 2012, 07:13 PM
              I didn't even have phx installed :O
              It is normal, PHx is not installed by default. Sorry I have forgotten to tell you this.
                • 22427
                • 793 Posts
                You wrote [+docid+] - it should be [+wf.docid+].
                  • 40024
                  • 72 Posts
                  Nope,i still get the same output.I have corrected the code and i already had the "OnParseDocument" checked(actually it is the only thing i have checked in there). I will look further into phx installation guide.Maybe there is an issue with the latest version and modx evolution.
                  By the way,shouldn't there be another [+wf.wrapper+] placeholder in the "else" part of the code?(i have added the placeholder now for you to see,but in my chunk i tried with and without it, to see whether i would get the right output,but it was to no avail).

                  <li[+wf.classes+]>
                      [+phx:if=`[+wf.docid+]`:is=`60`:then=`
                              [+wf.linktext+][+wf.wrapper+]
                      `:else=`
                              <a href="[+wf.link+]">[+wf.linktext+]</a>[+wf.wrapper+]
                      `+]
                  </li>
                    • 19369
                    • 1,098 Posts
                    @dinpapa, the problem here is that PHx is not working, it doesn't matter what you put inside PHx if it does not work. Make sure that you've installed it correctly. What version of MODX Evolution have you installed? I have used PHx from MODX Evolution 1.0.2+ without any problem.
                      • 40024
                      • 72 Posts
                      I am using MODX Evolution 1.0.6 .
                      I just checked my event log and it has a bunch of errors in regards to phx,but in the end i came through and now phx works. But still, i am not getting the desired result.I mean,menu outputs just fine,but i can't see the children of the 'About us" page(document with id=60).
                      @microcipcip You said that you checked ottogal's code and it worked for you.how did you make the Wayfinder call?I mean,what parameters did you use?