We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36820
    • 31 Posts
    Thank you coroico I think I managed to install zend framework.
    Today I was reading and checking which one of the examples could work for me. I think I need something similar like http://www.revo.wangba.fr/custom-package-dvd-shop-2/
    I am farily sure I will also need to implement a query hook as explained on that advsearchHook.pdf

    All examples show only one textfield.
    Now only 3 questions. I have got 5 textfields and 1 select field on that form. My frist question is about the line blow.
     [[+helpLink]]<input type="text" id="[[+asId]]_advsea-search" name="[[+searchIndex]]" value="[[+searchValue]]" />
       

    Is it nessesary to put an id on every textfield and also to use that
    id="[[+asId]]...."
    or is it only mandatory for one textfield?
    I suppose the name of the textfields have to be the same than the TV name which holds the information. What is that +searchIndex for? I suppose I must replace that
     [[+searchIndex]]
    with the name of that TV. Is that correct?

    It seems I must just follow that examples in the pdf like
    My TVs are product, company, field, region, zip, and place
    Third question: Is it correct if I create a snippet "Filter1QHook" and build the sippet following the pdf file and call the search like this?
    [[!AdvSearch? &queryHook=`Filter1QHook` &withTVs=`product, company, field, region, zip, place` ]]


    Thank you. I hope I am not too much bothering you.




      • 5811
      • 1,717 Posts
      All examples show only one textfield.
      Yes, You could have only one input text field to catch the search terms. These search terms will be use in the query.
      You could have some other additionnal input text fields, but in this case they will be used for the filtering of results

      asId is the id of the instance of search input field. By default the id as0 is used.
      If you have 2 searchForms, you need to provide two different asId inside the snippet calls, otherwise advSearch doesn't know for which snippet the parameters are.
      So yes, asId is mandatory for the input text field used for catching the search terms.
      For input text fields used for filtering, asId is useless.

      I suppose the name of the textfields have to be the same than the TV name
      No. But you will need to do the mapping between the http request variables sent and the TV names inside the queryHook.

      I suppose I must replace that
      [[+searchIndex]]

      with the name of that TV. Is that correct?
      No. searchIndex is by default replaced by "search" which is the name of the http request variable used to submit a request.
      By using &searchIndex=`something` inside the snippet calls you can change this default name. You could for instance use "q" rather "search"
      Most of the placeholders used inside the template are used and filled by the add-on. You don't need to change them.

      Third question: Is it correct if I create a snippet "Filter1QHook" and build the snippet following the pdf file and call the search like this?
      [[!AdvSearch? &queryHook=`Filter1QHook` &withTVs=`product, company, field, region, zip, place` ]]

      By using &withTVs=`product, company, field, region, zip, place`, you simply specify that the search should occurs inside these TVs
      Then the filtering is depending of your needs and should be implemented inside the queryHook
        • 36820
        • 31 Posts
        I see. I get the impression it is not possible to build a multiple search like the one I need using modx Revo so far.
        It is suprising and a bit disapointing for me to realize that the way I wanted to do that search is not possilbe. It would be the natural and most logical way for me and I think also for most users to use a multiple search like that.

        What was the reason for you to restrict that search to only one textfield and to filter results using select fields from what you get out of that one text field?


          • 5811
          • 1,717 Posts
          It is suprising and a bit disapointing for me to realize that the way I wanted to do that search is not possilbe.
          As I don't fully understand exactly which searchform and result list you want, please send me more details on my email. And I will answer you if it is possible or not.
            • 36820
            • 31 Posts
            Ok I have sent a more detailed description.
              • 5811
              • 1,717 Posts
              What was the reason for you to restrict that search to only one textfield and to filter results using select fields from what you get out of that one text field?

              I restrict the search to only one textfield, because using a search with multiple input textfields, is nearly like doing a filtering. With several input text fields, you need to apply the search inside specific fields (here TVs). The main difference is that I use the query syntax only on the "search" input text field. Not on the input text field used to filter the results.

              So to do a multiple search, simply remove the "search" input text field and add input text fields to catch the values for the TV product, place, company, ... And then set an appropriate queryHook to filter the results.

              So, rather to speak of multiple search, I prefer used the terme of filtering. And the main limitation is that I have not planed that you could use the query syntax on each input text field. Only on the input field provided by the searchIndex variable.

              Is your objective to be able to use the query syntax on all the input fields ?
              If not, filtering is enought.

              As example, look at this new demo. This is nearly the same as demo 1, but with input fields instead of select fields.


                • 36820
                • 31 Posts
                Alright. This example is almost what I thought of and what I need. I will try to make it work during the next few days and report back next week.

                Please excuse my silly questions because I dont know very much about php and MySQL but I would like to express my idea.
                What if we set all 6 text fields beeing ready to use the query syntax and you decide after submiting the form which field to use for your actual query syntax after you checked which text fields have been popuplated and you just use the first of those for you query syntax. All content in all other fileds are used as filter.

                That would enable the users to use whatever field or fields they want and to enter in the field whatever they search for and not only what is available in the select fields. I mean you can not provide 10000 zip numbers and several thousend places in a country by a select field and also not products as there might be even more than 10000 and I think it would be similar with company names.
                Do you think that is possible?
                I suppose I am asking you for too much but I wanted to explain my intention and I can imagine I am not the only who woud use something like that.

                have a nice weekend [ed. note: universal_next last edited this post 14 years, 3 months ago.]
                  • 5811
                  • 1,717 Posts
                  and you just use the first of those for you query syntax. All content in all other fileds are used as filter.
                  I think that this is too much complicated for the end user. All the fields should have the same behaviour. "Query syntax" compliant or simple.
                    • 3749
                    • 24,544 Posts
                    You might look at this for an idea of one way to simplify things: http://wordsmatter.softville.com/quotes.html. I'm not sure it will work in your situation, but it might.


                    ------------------------------------------------------------------------------------------
                    PLEASE, PLEASE specify the version of MODX you are using.
                    MODX info for everyone: http://bobsguides.com/modx.html
                      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