We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2740
    • 95 Posts
    I’m using Evolution 1.0.2 with PHx.

    I have placed a Ditto call within PHx that tests if a folder has any matching longtitles, if none are found ’no results’ should be displayed.

    [+phx:if=`[!Ditto? &parents=`21` &tpl=`list` &filter=`longtitle,[*longtitle*],7|id,[*id*],2`!]`:is=``:then=`no results`:else=`results`+]


    However even when I know there are no matching longtitles it always shows ’results’. Yet the Ditto call works outside PHx. I’ve tried adding &noResults to Ditto matching it to :is= but ’results’ is still shown. I’ve put the Ditto call in a Chunk and called it from PHx and still it never shows ’no results’.

    Has anyone any idea what I’ve done wrong please?
      • 4971
      • 964 Posts
      Dont know what is wrong, but...
      I have used PHx inside Ditto and not the other way...
      I have set the PHx if call in the &tpl parameter with two
      tpl chunks and it works...

      maybe that will help you...
        Website: www.mercologia.com
        MODX Revo Tutorials:  www.modxperience.com

        MODX Professional Partner
        • 20413
        • 2,877 Posts
        PHx breaks...
        I think it comes down to this: http://modxcms.com/forums/index.php/topic,42498.msg254641.html#msg254641

        Ditto is very heavy. A TV with a select binding would be smarter.
        http://modxcms.com/forums/index.php/topic,5814.msg232384.html#msg232384

          @hawproductions | http://mrhaw.com/

          Infograph: MODX Advanced Install in 7 steps:
          http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

          Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
          http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
          • 2740
          • 95 Posts
          Thanks charliez and mrhaw for your suggestions.

          @charliez: I’ll have a look at using PHx inside Ditto if I can’t find another solution, it’s certainly not something I was aware you could do.

          @mrhaw: I’m fairly new to modx so I’ll have to look at how to use TV with a select binding. I’ve posted my full (horrendous) PHx call below:

          [+phx:if=`[!Ditto? &parents=`21` &tpl=`ditto_articles` &filter=`longtitle,[*longtitle*],7|id,[*id*],2` &orderBy=`published_year ASC`!]`:is=``:then=``:else=`<tr><td class="lf_td">Books:</td><td class="rt_td">[!Ditto? &parents=`21` &tpl=`ditto_articles`  &filter=`longtitle,[*longtitle*],7|id,[*id*],2` &orderBy=`published_year ASC`!]</td></tr>`+]


          In my simplified code in my first post I was just outputting ’no results’ or ’results’, but what I’m trying to output is a table row and list, could using a TV with a select binding achieve this?