We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 35764
    • 35 Posts
    Hi, I am using the Ditto snippet in a product catalog.

    I want to call all the product pages that meet BOTH tag criteria, for example this is the ditto call I am using

    [!Ditto? &parents=`6`&depth=`5`&orderBy=`pagetitle ASC` &tpl=`ProductListTpl` &paginate=`1`&paginateAlwaysShowLinks=`1`&display=`15`&hideFolders=`0`&extenders=`tagging`&tagData=`productcategory`&tags=`10` &tagData=`manufacturer`&tags=`9` &tagDelimiter=`,`&tagDisplayDelimiter=` `!] 
    



    I only want to show product pages that have the productcategory tag ’10’ AND the manufacturer tag ’9’. Currently it’s showing me all the pages with EITHER tags.

    Any help appreciated.

    Thanks

    Lisa
      • 22427
      • 793 Posts
      &tagData=`productcategory`&tags=`10` &tagData=`manufacturer`&tags=`9`
      The parameters [tt]&tagData[/tt] and [tt]&tags[/tt] may not occur twice in the Ditto call.

      You could try two nested Ditto calls, where the outer one is filtering the [tt]productcategory[/tt] tags and the inner one the [tt]manufacturer[/tt] tags.
        • 35764
        • 35 Posts
        can you nest ditto calls, i didn’t realise that was possible.

        thanks

        Lisa
          • 22427
          • 793 Posts
          I meant it that way:
          Create a Ditto call (the "inner" one) which outputs a comma separated list of the IDs of those product pages who meet the condition "productcategory is 10".
          Write this Ditto call into a Chunk named, say, "[tt]prodcat10[/tt]".
          Then the "outer" Ditto call should be done like
          [tt][!Ditto? &documents=`{{prodcat10}}` .... !][/tt]
          wherein you have to provide the condition "[tt]manufacturer is 9[/tt]".
          (Just an idea - I didn’t try it out.)
            • 4310
            • 2,310 Posts
            You can have multiple tagData & tags e.g.
            &tagData=`productcategory,manufacturer` &tagMode=`onlyAllTags` &tags=`10,9`

            This won’t work if the tags options for each tagData are the same i.e. both are numeric and in the same range of numbers.