We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38713
    • 91 Posts
    Hi guys,

    I've just set up a custom query hook which is working fine and all properties for the AdvSearch snippet seem to work except for 'withFields'.

    I've tried all variations like limiting just to alias and blank eg withFields=`` which is what i want but it's just not working any ideas.

    MODX 2.2.4
    AdvSearch 1.0.0 pl2

    Any help is much appreciated!

    Alex
      Twitter @alexmercenary
      • 5811
      • 1,717 Posts
      Could you post your advSearch snippets calls et give some information about the fields you want search in (&withFields). Especially if they are TVs.
        • 38713
        • 91 Posts
        Hey coroico!

        Thanks for getting back to me.

        Ok here they are:
        [[!AdvSearchForm? &tpl=`propertySearchForm` &landing=`11` &method=`post`]]

        [[!AdvSearch? &queryHook=`propertySearchQHook` &withFields=`` &withTVs=`propertyLocation, propertyType, propertyNoBeds, propertyPrice` &toPlaceholder=`propertySearchResults`]]


        I want withFields to be =`` as i don't want to search in resource fields at all for this purpose.

        Awesome extension by the way!!!

        Thanks,

        Alex
          Twitter @alexmercenary
          • 5811
          • 1,717 Posts
          Did you see this demo

          By using &withFields=`` you don't search inside the document fields.

          Why do you say that it's not correct ?


            • 38713
            • 91 Posts
            That demo is exactly what i want to do, its just not working for me.

            I only want to search in TVs and not in document fields so i have set &withFields=`` but it is still searching in document fields.

            Do i need to add anything to my query hook? I have used your 'Filter1QHook' and just changed your $andConditions array to suit my TVs

            Thanks,

            Alex [ed. note: alexmercenary last edited this post 14 years, 3 months ago.]
              Twitter @alexmercenary
              • 38713
              • 91 Posts
              Update!!

              Sorry for wasting your time Coroico, it was my fault! When i set up the TV's i assigned them to all have a default value and added it to the main template so all resources had TV values, so it was finding the values in all resources.

              I've removed the TVs from the Main Template and moved them to the specific Template and assigned the template to the neccessary resources.

              All works fine now apart from when i choose select option 'all' rather then choosing a specific selec option like say '10' is still returning all resources. outside of the defined scope.


              Thanks,

              Alex

                Twitter @alexmercenary
                • 38713
                • 91 Posts
                Ok thats fixed as well now, i download your getIds add on and restricted the search to children of a certain parent!!

                Everything is working, I'm sorry again for wasting your time Coroico.

                AdvSearch is absolutely awesome though, well done and thanks.

                Thanks again,

                Alex
                  Twitter @alexmercenary