We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36820
    • 31 Posts
    I need to create a multiple search form holding fields for product, company name, zip, field and town. Each field can be filled in or left blank. This form is to be placed on the start page.
    There is a list of ressoures within ID 2 (companies) holding containers for provinces and places. The companies will be placed inside that places and hold the information that is searched for.
    The result of that search should be the appropriate data sets from that ressources and be listed on the results page which should be different from startpage and company page.

    I dont know which Addons to use for that multiple search and result list. Has someone made something like that with revo already? [ed. note: universal_next last edited this post 14 years, 3 months ago.]
      • 813 ☆ A M B ☆
      • 326 Posts
      There may be a specific search add-on that does this; however, I'd probably just use getResources.

      Depending on how comfortable you are with the API, this could be done a few different ways, but what you're trying to do would be to pass search parameters into the results page via the URL as query string parameters, and then use either a.) a getResources wrapper snippet or b.) a pre-built add-on like getUrlParam to construct getResource's &filter parameter. More info on that here (look for tvFilters):

      http://rtfm.modx.com/display/ADDON/getResources

      I prefer this method over a "true" search because it gives you the flexibility that comes with getResources, and since you're searching the MODX page tree anyway, it's an appropriate fit. Does that make sense? I can try to create an example if it doesn't.

        • 3749
        • 24,544 Posts
        I've never used it, but this might be what you want: http://modx.com/extras/package/simplesearch.

        It doesn't search for TV values, bu I think it would be significantly faster than getResources and would probably allow more refined searches. If you need to search for TVs, getResources or a custom search snippet are options.

        You probably already know this, but you can very easily create a site search using Google. It's *very* fast because Google will have an index to your site. You can try it using the form at the bottom of any page of the site in my sig.



        ------------------------------------------------------------------------------------------
        PLEASE, PLEASE specify the version of MODX you are using.
        MODX info for everyone: http://bobsguides.com/modx.html [ed. note: BobRay last edited this post 14 years, 3 months ago.]
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 36820
          • 31 Posts
          Thank you very much aladage and BobRay. I am sorry I did not explain it detailed enough.
          @aladage I am only a designer and my programming knowledge is only basic and I dont know much about the API. Is there a detialed howto for that "pass search parameters into the results page via the URL as query string parameters" ? Would it still be possible to use friendly URLs if I decide to pass search parameters into the results page via the URL ?
          @BobRay
          I have seen that simpleSearch already but have not used it so far. I thought it would not meet my requirements as a multiple search is not a simple search but I will also try this one and I am afraid I will soon be back with more questions. I did not know about that goole search. It is very quick but I do not want visitors to leave me site at any circumstances. I know it is a search only on your website but it is not what I am looking for. I get goose bumps only by looking at the address line of the browser after the google search. smiley
            • 5811
            • 1,717 Posts
            May be you could look at AdvSearch add-on. See faceted search demos on the demo site for complex queries.
              • 36820
              • 31 Posts
              Thank you coroico that looks great. I am sure this one is definitively capable to create what I want. Now I can start right away trying to make it work.
              Btw I am using Revo2.2.2. at the moment but will upgrade to 2.2.5 as soon as it is released.
              I think I used a snippet from that same programmer a few years ago for a mulitple search for Evo which worked very well.
              I think my question is solved so I mark it solved but it could be I will have more questions comming up while I try to make it work.
              Thank you all for you great care and very helpful comments.
              [ed. note: universal_next last edited this post 14 years, 3 months ago.]
                • 5811
                • 1,717 Posts

                If needed I offer customization around AdvSearch. So, feel free to request a quotation for your search component.
                  • 813 ☆ A M B ☆
                  • 326 Posts
                  It sounds like the consensus with the group is to use a search-specific add-on, and they're probably right (Bob would be the guy to know!).

                  If you did decide to go the getResources route, you'd basically be nesting the getUrlParam inside your getResources call. So, it would look something like this (I highly doubt this would work as-is, but should show you the idea):

                  [[!getResources? &tvFilters=`searchTermTV==%[[!getUrlParam? &name=`searchterm`]]%` ]]
                  

                  In that example, "searchTermTV" is the name of the TV that contains the data in your resources, and "searchterm" is the query string parameter you pass through your form.

                  You're right, though, that this could create ugly URLs. The alternative would be to submit the form data using $_POST and grab the submitted query that way, but that would probably require a custom wrapper snippet to grab and sanitize the values, and pass them on to the getResources call.

                  But again, just a proof of concept. An actual search add-on is probably better.
                    • 36820
                    • 31 Posts
                    OK aladage that is nice I will keep that in mind and have a try in case I cant manage the other ideas but I think I will need something like simplesearch or better advsearch because of the complexity of my queries.
                    Thank you coroico. I will most likley need help on that. Give me just a few attempts myself before I ask you for a quotation.

                    I reopend this entry because i got stuck only on the beginning but I am not sure if there is somebody who would like to give me more infos because my questions this time is slightly off topic.

                    That advSearch Addon apparently requires
                    "Zend library 1.11 (You should manually install this library)"

                    May I explain here my confusion and ask for help ? First it would be only about getting ZF to work.


                    [ed. note: universal_next last edited this post 14 years, 3 months ago.]
                      • 5811
                      • 1,717 Posts
                      Simply follow the step by step installation chapter from the AdvSearch documentation.
                      You can download these documents from this page.

                      From this page: http://www.framework.zend.com/download/latest you could download the Zend framework minimal package. Then follow the installation steps described in the documentation.