We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5340
    • 1,624 Posts
    HI,

    I am using Wayfinder like

    [[Wayfinder? &startId=`0` &level=`1` &firstClass=`first` &rowTpl=`mainMenuRowTpl`]]


    +rowTpl

    <li[+wf.id+][+wf.classes+]>
    	<a href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+]>[+wf.linktext+]  [*`[+wf.docid+]`:is=`7`:then=`A`:else=`X`*]</a>
    	[+wf.wrapper+]
    </li>



    This line does not work correctly

    [*`[+wf.docid+]`:is=`7`:then=`A`:else=`X`*]


    Outputs "X" all the time


    I also tried
    [+wf.docid:is=`7`:then=`A`:else=`X`+]

    This one does not work at all.

    Basically I’m trying to add a piece of text if the document id is 7.

    Thx for your help
      • 25260
      • 156 Posts
      isn’t the correct syntax

      [+phx:if=`[+wf.docid+]`:is=`7`:then=`A`:else=`X`+]

      ?

      by the way, I don’t know if PHx can work inside a Tpl.

      I wanted to use [+wf.title:lcase+] but it didn’t return anything, so I found another solution.
        • 5340
        • 1,624 Posts
        I also tried this

        [*`7`:is=`7`:then=`A`:else=`X`*]


        No luck. I guess I have to do it in another way


        Thx
          • 24495
          • 407 Posts
            • 5340
            • 1,624 Posts
            I get this when using it with ditto


            Fatal error: Cannot redeclare class prePHx in /home/cipalab1/public_html/modxrules.com/assets/snippets/ditto/classes/phx.pre.class.inc.php on line 11

            Any ideas. Should I upgrade Ditto too.
              • 24495
              • 407 Posts
              Ditto has its own built-in phx parser. It should work with or without PHx installed separately. Is it a fresh installation of MODx/Ditto? Which version(s)? When do you get this error? More infos please.
                • 5340
                • 1,624 Posts
                HI,

                I’m using Evo with Ditto 2.1 and PHx 2.1.3.

                Wayfider baing the main menu is called first. I am just guessing Ditto does not check if prePHx is declared or not

                here’s the order of the calls

                [[Wayfinder? &startId=`0` &level=`1` &firstClass=`first` &rowTpl=`mainMenuRowTpl`]]
                [!Ditto? &parents=`2` &depth=`1` &tpl=`@FILE:assets/templates/site/chunks/article.html` &showInMenuOnly=`1`!]

                I will try to switch the order of the calls and see if it makes a difference.