We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23183
    • 102 Posts
    I have a drop down box to display a certain number of results per page by going to a URL with &ditto_display= on the end.

    I also want to be able to show certain results idealy by a TV value, but if easier I could probably get away with filtering by a word from the content.

    Ive tried adding &ditto_filter=1_1_1 (where 1’s are the values of the filter) will this solution work? If so what do you seperate the values with? It is loading the page but diplaying "No Results" so the filter is not working.

    Ive read about possibly using the &tags= option in the URL, but how do I tag each ditto document?

    Any help/advice appreciated
      • 26931
      • 2,314 Posts
      Hi PHiL,

      i think you could use this approach: http://wiki.modxcms.com/index.php/Dropdown_Menu_with_Ditto (maybe there’s a better one for your scenario)

      ...instead of the dropdown chunk which will be displayed as <option>, you could use several Ditto calls with different filter options

      if you want more filter options you could also have a look at tvExplorer http://modxcms.com/forums/index.php/topic,16456.0.html
        • 23183
        • 102 Posts
        Thanks for the reply sahrkbait,

        so in that example the dropdown list will be populated with links to all child documents of the parent?

        I need to have it so I have one option i.e. ’cars’ and when selected it would display only child docus with a cars TV.

        How would I go about creating a seperate ditto call with my filter in place and then calling it when the option value is selected?

        Sorry to be dumb, just on my first modx project and strggling with the last few features!
          • 26931
          • 2,314 Posts
          haven’t tried it yet, but if you are using tags for your documents, this could work:

          <script language="JavaScript">
          function jumpTo(selObj){
          thevalue = selObj.options[selObj.selectedIndex].value;
          if (thevalue != 0) window.location= thevalue;
          return false
          }
          </script>
          
          <form action="#" onsubmit="return false" method="post">
          <select name="goto" onChange="jumpTo(this);">
          <option value="please choose one">Please choose one</option>
          <option value="[~id~]&tags=yourtag1">yourtag1</option>
          <option value="[~id~]&tags=yourtag2">yourtag2</option>
          <option value="[~id~]&tags=yourtag3">yourtag3</option>
          </select>
          </form>


          related: http://modxcms.com/forums/index.php?topic=41353.0

          http://www.pogwatch.com/ditto/ditto-extenders/ditto-tagging.html
          http://ditto.modxcms.com/files/assets/snippets/ditto/extenders/tagging-extender-inc-php.html
            • 23183
            • 102 Posts
            Thanks mate got it working using a TV to set the ’tag’ cool

            On that page it can eitehr be active or expired, however my next problem is I have a three way option -

            Mens, Womens and Unisex, can you set multiple tags?

            I want to be able to have ’mens’ and ’womens’ in the dropdown, so I can set a tag to say if it is mens or womens, but I need to show the unisex items on both options, can you set multiple tags?

            Thanks for your help, much appreciated
              • 23183
              • 102 Posts
              The only way I can think of using this method is to exclude documents by tag, this way I could exclude mens or womens and always show unisex - would this be possible?

              I tried adding a tag deliminater ’,’ and putting two tags in the URL e.g. &ditto_tags=mens,uni

              but doesnt work..
                • 26931
                • 2,314 Posts
                The only way I can think of using this method is to exclude documents by tag, this way I could exclude mens or womens and always show unisex - would this be possible?
                i think you would need tvExplorer for that http://modxcms.com/forums/index.php/topic,16456.0.html

                someone please correct me if i’m wrong smiley
                  • 23183
                  • 102 Posts
                  Just found this:

                  &tagMode
                  Purpose: Select or hide documents with all or any of the tags
                  Values:

                  * onlyAllTags show documents that have all of the tags
                  * onlyTags show documents that have any of the tags
                  * removeAllTags remove documents that have all of the tags
                  * removeTags documents that have any of the tags

                  Default: onlyTags

                  So I can exclude mens or womens, that should do the trick!

                  Thanks for your help sharbait grin
                    • 29197
                    • 13 Posts
                    Hello, I almost understand this, but how to make filtered results visible? How to pass parameter to the same page - what is needed to type in template?
                      • 16278
                      • 928 Posts
                      You can use the &tags parameter if it’s fixed, or include the tags in the URL if variable. Example at http://www.pogwatch.com/ditto/ditto-extenders/ditto-tagging.html.
                      smiley KP