We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4749
    • 623 Posts
    Coroico,
    I know AS doesn’t support multiple calls on the same page, but I was wondering if you ever though of making a dummed-down version of AS for simple searches. For example, right now I’m using Ditto to find articles and return them to a product page that has some association, BUT the problem is that there has to be some tags associated with the articles in order for ditto to find them. Is there a way to have (AjaxSearch Lite) a version of the snippet that will search all document content onPageRender and return links to relevant files without conflicting with the search box? This would be a fantastic snippet and would really be unique. I’m not sure, but stripping some of the AS features, maybe AS could already do this with minor changes.
      The MODx has you...
      Utah Web Design
      • 33372
      • 1,611 Posts
      @cbaone: You might check out tvExplorer. It’s complicated to set up and heavy on system resources, but it can do some pretty cool things. It makes use of Ditto and a modified form of AjaxSearch to do its thing.
        "Things are not what they appear to be; nor are they otherwise." - Buddha

        "Well, gee, Buddha - that wasn't very helpful..." - ZAP

        Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
        • 4749
        • 623 Posts
        @ZAP: I think tvExplorer is a fabulous tool, but what I need it for it’s over the top, too much. What I need is for a tool to search all available documents based on predetermined search criteria to return all related documents as the page loads. I don’t want a live search, I don’t want any interactivity - it needs to be done in the background. Ditto would be perfect if it could scan the content and pick out keywords, but alas, it can’t. I’m just a wishful thinker anyway!

        Isn’t there a snippet that reads your mind, builds your site, and manages itself? laugh


          The MODx has you...
          Utah Web Design
          • 5811
          • 1,717 Posts
          @cbaone,
          Is there a way to have (AjaxSearch Lite) a version of the snippet that will search all document content onPageRender and return links to relevant files without conflicting with the search box? This would be a fantastic snippet and would really be unique. I’m not sure, but stripping some of the AS features, maybe AS could already do this with minor changes.
          Let me reformulate your request, to be sure, that I understand ...
          when a page is displayed, you would like an automatic indexation of relevant terms of content and as result an additional link on the page to an index page where for each term a link to the other possible documents related to each term.

          Is it a correct understanding ?
            • 4749
            • 623 Posts
            Coroico,
            Very close. I just want ajaxsearch to do what ditto does, but on a wider scale. I want to search all documents for a specific term and return the matches. For example, if I have a product page about Red Shoes I want to automatically retrieve three articles or blog posts, or news items from anywhere on the site without having to use tags to do it.

            Let me just say that I have Ditto configured to do this and it’s working perfectly, but the problem is I have to set up TV’s and tag EVERYTHING for it to work, but it does work, so I’m happy about that. But, it would be a great help to be able to do something like this:
            [!ajaxMiniSearch? &tpl=`TPL` &searchTerm=`[*longtitle*]` !]

            That way it’s automatic like Ditto, but more comprehensive than Ditto because it can search for specific terms in the content area, which Ditto cannot do. This is not a complaint. I am very happy with both Ditto and AS, but I was just thinking out loud. Thanks for reading!
              The MODx has you...
              Utah Web Design
              • 33372
              • 1,611 Posts
              Actually that sounds more like a job for a Ditto extender, and if you post to the Ditto forum Mark might get you started towards getting one.
                "Things are not what they appear to be; nor are they otherwise." - Buddha

                "Well, gee, Buddha - that wasn't very helpful..." - ZAP

                Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
                • 5811
                • 1,717 Posts
                I want to search all documents for a specific term and return the matches
                This is an interesting suggestion. It is easy to introduce the parameter &searchTerm=’something’ and when this parameter is set, avoid to display the search input form (&showForm=`0`) and display the results found on a landing page with paging if needed. Regarding the template, in the version 1.8 you will be able to customize the output results and layout as you want. A specific AjaxMiniSearch is not necessary. I prefer add a new optional parameter.
                  • 4749
                  • 623 Posts
                  Coroico,
                  That is a good idea, but I have a question... What if there is already an ajaxSearch call on the page? There can only be one AS call on a page, right? Because I have a sitewide search, but I also have the "mini-search" listing documents too. So, wouldn’t there be a conflict? I’m sure if there was only one search call on a page that it could be done, but since there are two it’s not possible at the moment. Let me know your thoughts.
                    The MODx has you...
                    Utah Web Design
                    • 5811
                    • 1,717 Posts
                    For the moment it’s not possible to call two instance of AS on the same page.
                    With ajaxSearch=1 (ajax mode) the javascript parameters are overwritted by the last call to AS. And the Php part called by ajax use these last values >:(

                    To overpass this limitation, I think that it’s necessary to :
                    1/ adds an id in the call like &asId=`any key identifier`
                    2/ in the php code, manage a php object search and associate all the parameters receive to each search object created by an as call
                    3/ create a json structure with the name asId with all the javascript parameters that should be transmitted to the ajax part
                    4/ send the name of the json structure to the javaScript code when the input form is submitted
                    5/ in javascript, retrieve the correct values and send it to the Php part which build the window results

                    And obviously, send by post or by url, at each time, the asId identifier

                    But for your "AjaxMiniSearch" is more simple, because, as you will display the results on a landing page (not in an ajax window), you will never call the ajax part. So a correct management of php parameters for each search object created should be enought.

                    What is missing, is the time to implement all these ideas wink
                      • 4749
                      • 623 Posts
                      Thanks for thinking about it. It’s not necessary at the moment I just brought it up as a possibility. It may not be a very popular feature, but I do think it’s very useful if it could be implemented. So, don’t worry about time, you’ve got enough to deal with. wink

                      Thanks again!
                        The MODx has you...
                        Utah Web Design