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

    I’m using Evolution 1.0.2 with PHx and I’ve stumbled upon a minor bug when it comes to accessing Ditto placeholders inside chunks.

    It seems that if you want to test a ditto placeholder for a specific value using the following PHx if-then-else pattern:

    [+phx:if=`[+this+]`:is=`[+that+]`:then=`do this`:else=`do that`+]


    [+this+] needs to be used somewhere within the chunk first or else it the PHx condition won’t parse properly. Hope someone finds this tip useful. Anyone else encountered this?
      • 12808
      • 70 Posts
      Exactly the same problem...

      I’m listing documents with ditto, but want to show data depending on TV value.
      TV "atraktivno" is radio button with values Da||Ne, default Ne.

      Ditto tpl (nothing is shown):

      [+phx:if=`[+atraktivno+]`:is=`Da`:then=`Atraktivno`:else=``+]


      Solution:

      [+atraktivno+]
      [+phx:if=`[+atraktivno+]`:is=`Da`:then=`Atraktivno`:else=``+]
      


      Better solution:

      <div style="diplay:none">[+atraktivno+]</div>
      [+phx:if=`[+atraktivno+]`:is=`Da`:then=`Atraktivno`:else=``+]
      


      Any ideas why this is happening?

      Thanx,
      Ivan
        --
        www.spotkg.com
        • 33337
        • 3,975 Posts
        Ditto has built in PHx class, you may try to turn off Ditto’s Phx by using &phx=`0`
          Zaigham R - MODX Professional | Skype | Email | Twitter

          Digging the interwebs for #MODX gems and bringing it to you. modx.link
          • 4172
          • 5,888 Posts
          may be Ditto cannot see placeholders nested in your phx, so it doesn’t get its values from database.
          you can try
          [!Ditto? .............  &hiddenFields=`atraktivno`!]
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 12808
            • 70 Posts
            Calling ditto with &phx=`0` has no effect, but with &hiddenFields=`atraktivno` everything working great...

            Thanks,
            Ivan
              --
              www.spotkg.com