We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10896
    • 76 Posts
    I’m using Reflect to output the wordpress style date archive listings. However I have two documents in the container that I want to filter out. I’ve been able to filter them from the ditto results using the ’filter’ parameter, but I’m not sure what to do with Reflect. I’m getting an archive listing of Dec 1969 for the two items that don’t have a publish date -- that I don’t want showing in the listings.

    Can anyone help me filter these two docs out of the listing?

    Thanks.
      • 10487 MODX Staff
      • 1,535 Posts
      If you’re using the latest Ditto/Reflect 2.1 beta, you should be able to pass the filter snippet parameter straight into your Reflect snippet call as you have done already in the Ditto call.

      Or, if you’re using a previous version, you can check out the &dittoSnippetParameters snippet parameter for Reflect, this will allow you pass the filter as well. Check ditto.modxcms.com for more information on how to use that parameter.

      Hope that helps,
      Garry
        Garry Nutting
        Senior Developer
        MODX, LLC

        Email: [email protected]
        Twitter: @garryn
        Web: modx.com
        • 10896
        • 76 Posts
        NOTE: I found where to download the 2.1 beta off ditto/reflect here

        http://modxcms.com/forums/index.php/topic,14925.0.html

        I will install this and post my findings here when finished.
          • 10896
          • 76 Posts
          garryn

          I upgraded to ditto/reflect 2.1 beta. Now my reflect results are nothing. Before they would list the month and year appropriately I just couldn’t filter out the results I wanted to. Here is my reflect snippet. Can you spot where I’m going astray?

          [!Reflect?config=`wordpress` &targetID=`31` &getDocuments=`1` &dittoSnippetParameters=`parents:8` &id=`wp` &dateSource=`pub_date` &monthSortDir=`DESC` &tplContainer=`blog_tplContainer` &filter=`id,22,2|id,31,2` !]
          


          thanks
            • 18397
            • 3,250 Posts
            Try removing the tplContainer as the new version of Reflect has a different templating engine. Also, you can’t have both &dittoSnippetParameters and normal Ditto parameters in the call. One or the other; preferably the latter.
              • 10896
              • 76 Posts
              Well, I got around the issue on that last site but I’ve come smack into this problem again. Here’s my reflect call. I’ve upgraded to 2.1.beta

              [!Reflect? &config=`wordpress` &targetID=`22` &getDocuments=`1` &id=`wp` &dateSource=`pub_date` &tplContainer=`archive_tplContainer` &parents=`19` &filter=`id,53,2|id,22,2` !]
              


              According to my understanding I should be able to pass &parents and &filter into reflect as they are normal ditto parameters. Correct? It continues to ouput the expected results along with December 1969 which is because the doc (53) and doc (22) isn’t getting filtered out of the results.

              Can anyone help?
                • 18397
                • 3,250 Posts
                Try with just:
                [!Reflect? &targetID=`22` &getDocuments=`1` &id=`wp` &dateSource=`pub_date` &parents=`19` &filter=`id,53|id,22` !]