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

    I am looking to set up a ditto snippet where I want to return all pages which have an empty value for a template variable e.g. ’varX’.

    Where and how do I add the clause to find pages that have an empty value for varX.

    Current code is below:
    [[Ditto? &parents=`5` &orderBy=`createdon DESC` &tpl=`features-module` &extenders=`summary` &hiddenFields='articleThumb']]


    Thanks in advance
      • 26016
      • 561 Posts
      Hi,
      I wonder if this might work for you... filtering:
      http://ditto.modxcms.com/tutorials/basic_filtering.html

      I am usually searching for a string, so I’ve never searched for "nothing". I’m honestly not sure if single or double quotes will work in a filter.

      In any case, you could try something like this in your call:

      &filter=`varX,'',1`


      Good luck, Dave
        MODx and Wordpress development
        Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4