We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5950
    • 44 Posts
    Is there anyway to pass the selected values to Ditto so that the results are sorted by the fields that were selected?

    For instance, my form has 5 fields: Video, Data, Audio, Contact and Ethernet. Ditto currently sorts results in that same order, but if someone doesn’t make a selection for Video, it can lead to strange sorting on their results page (see attached example; a sort for 2 Ethernet... the exact matches actually end up listed last. For broader searches the best match sometimes ends up on the second or third page!).

    So I’d like to only pass sort values to Ditto from the selects chosen by the user in the form. Is something like this possible? Or even a "closest match" or "best match" option?

    Thanks again!
      • 3115
      • 3 Posts
      A great snippet but having problems with FriendlyURLs on modx 1.0.3

      with out friendly URLs the search works great creating the URL
      /index.php?id=7&new=new&search=search

      but with Friendly URLs on
      7.html%E2%80%9C%20method=?new=new&search=search

      thus not searching/filtering documents

      the following seems to be added %E2%80%9C%20method=?

      any ideas help appreciated

        • 27351
        • 7 Posts
        I tried to use another template for the default select-chunk (tvExplorer-Select) with the parameter &selectTV but it has no effect. it seems that the chunk tvEditor-Select is used for displaying instead of tvExplorer-Select.

        here is my call:
        [[tvExplorer? &dittoName=`Ditto` &selectTPL=`maTvEditorSearchSelect` &formTPL=`maSeachForm`&dittoSnippetParameters=`tvefilter,@FILE assets/modules/yams/yams.extender.inc.php|tpl:blog.first.tpl|summarize:5|debug:0|paginate:1|parents:5|lang_id:(yams_id)|language:(yams_mname)`]]

        any idea?
          • 33968
          • 863 Posts
          I’ve set up the form on a property site and after a bit of tinkering it seems to be working and filtering great, thanks!
          The search form sends the search results to a placeholder on a different ’Search Results’ page.

          I have a little problem however in that I have a separate Ditto call in a panel on that target page, set up to display the 4 most recent documents within a certain category.

          When there is only one page of search results all is fine, but when search results pagination kicks in and I click through to the 2nd, 3rd, etc pages, the other ’recent documents’ panel also moves on to a ’second page’ of listings. Because this has been limited to 4, it shows the lovely ’no documents found’ error.

          Anyone know how I can stop the other Ditto panel being affected by the search results pagination?
            • 26931
            • 2,314 Posts
            Anyone know how I can stop the other Ditto panel being affected by the search results pagination?
            try adding unique &id parameters to your Ditto calls http://ditto.modxcms.com/files/snippet-ditto-php.html
              • 33968
              • 863 Posts
              That did it. Now I think about it, the pagination placed under my search results was generic, so of course it would have been affected by any other Ditto call on the page. Thanks sharkbait!
                • 33968
                • 863 Posts
                My search results are outputting a list that is by default ordered by ’price’ in Ascending order.

                Search results appear on a different page than the initial TvExplorer form.

                How might I add a drop-down box or button to allow the user to change the sort order to Descending, or perhaps to sort by a different TV?

                I have some ideas about including the same tvExplorer call but with different sort parameters inside a form on the search results page, although I’m not sure how to have it apply to the current set of search results featured on the page. Something to do with ’&save’ perhaps?
                  • 26931
                  • 2,314 Posts
                  How might I add a drop-down box or button to allow the user to change the sort order to Descending,
                  e.g. http://www.pogwatch.com/ditto/ditto-config.html
                    • 33968
                    • 863 Posts
                    That would do it! thanks

                    *** Edit ***

                    Hmmm... I’ve got this partially working and can sort results by manually adding order parameters to the url in the browser address bar. Ending up with something like:

                    /search-results?textSearch=&ptyPrice-0=400000&search=search&order=down


                    But I want the user to be able to sort results via a link or drop-down. How can I build a link that grabs the page url including all current search parameters, and then appends either &order=down or &order=up?

                    I’ve tried:
                    <a href="[(site_url)][~[*id*]~]&order=down">

                    but this produces the url /search-results&order=down and I lose all the search parameters.

                    Would I need to build a snippet that uses something like the Smart ModX Url function? Javascript? Or could it be simpler? Not sure how to do it!


                    *****

                    Ok, found a solution. If anyone is interested, have a look here: http://modxcms.com/forums/index.php?topic=50945.0

                    There’s probably an answer to everything on these forums, not always easy to find what you’re looking for though undecided

                      • 36820
                      • 31 Posts
                      Wrong chunk is displayed:

                      I built a homepage with 2 languages using YAMS. tvEditor and tvExplorer are used to search and display for personnel references selected on zip codes.

                      If I put in my tvExplorer call only in german page it all looks great. If I put in the tvExplorer call in the english page as well, the english search chunk is dispalyed not only on the english page but on german page too.
                      Even if I called &formTPL=`search_de` and on the english page &formTPL=`search_en` nothing changed.
                      As soon as I remove the english call everything is alright on the german page.

                      [[tvExplorer? &dittoName=`Ditto` &formTPL=`search_(yams_id)` &dittoSnippetParameters=`tpl:ReferenzenListe_(yams_id)|summarize:30|debug:0|paginate:1|depth:4|parents:5|display:all|dateSource:Referenzdate|sortBy:Referenzdate|showPublishedOnly:1`]]
                      [+tve.searchForm+]

                      The search chunks are named search_de and search_en

                      What is wrong????