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

    We’re trying to achive something using Ditto in 1.0.5 that sounds like it should be possible, but no matter what we change it to, the required result doesn;t appear.

    We have a site that has now got a small fairly self contained section within it. this news we have added a template variable to, to allow the editor to mark a news article as categoryA or categoryB. These two categories then get filtered onto a jQuery tabbed section within the site. The news also needs to be displayed on the homepage of the micro site, filtered on the two categories, to display the news for the micro site.

    Now, we were planning on using a ditto call for this, and applying a filter, but everytime we apply two filters using the | we get no documents returned.

    this is the ditto call that we have:

    [!Ditto? &startID=`1082`&sortBy=`createdon` &sortDir=`ASC` &depth=`4` &summarize=`5` &total=`5` &tpl=`updates` &tplFirst=`updates_first` &filter=`RegionalNewsFeature,3946,1|RegionalNewsFeature,3945,1`!]

    Some of the articles i have read show people that have made this work, but it seems as if they are applying the filter to two different tv’s, so therefore the filter is applying an AND statement and not an OR statement which is what we need. has anyone managed to achieve this?

    Thanks

    Tony
      • 33968
      • 863 Posts
      Hi Tony

      The way your filter is set up, Ditto will interpret it as:


      • exclude any article whose ’RegionalNewsFeature’ does not equal 3946; OR
      • exclude any that does not equal 3945.

      So basically, exclude everything smiley

      Is RegionalNewsFeature the category (TV) you are trying to filter by?
      And 3946,3945 are the ids of articles you want promoted to the home page? Or are they category values that are unlikely to change. Could you clarify?
        • 13195
        • 5 Posts
        Lucas,

        The TV is called RegionalNewsFeature yes, and within that there will be (amongst others) categoryA(ID = 3946) and categoryB(ID 3945) values. what we would like is to get all of the articles that are associated with both of the above values for the homepage.

        Thanks for your quick response

        Tony
          • 33968
          • 863 Posts
          I think your best bet would be to use the tagging extender for Ditto.

          http://wiki.modxcms.com/index.php/Tagged_blogging_with_Ditto

          You can use your existing RegionalNewsFeature TV to pull the tags from, and your Ditto call would then be something like:
          [!Ditto? &startID=`1082` &sortBy=`createdon` &sortDir=`ASC` &depth=`4` &total=`5` &tpl=`updates` &tplFirst=`updates_first` &tagData=`tvRegionalNewsFeature` &tagDelimiter=`,` &tagMode=`onlyTags` &tags=`3945,3946`!]
          


          Let’s see how that goes...
            • 13195
            • 5 Posts
            Lucas,

            Thanks for the response, this worked perfectly. You’ve saved us so much time

            Thanks

            Tony
              • 33968
              • 863 Posts
              No problem wink