We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43774
    • 3 Posts
    too sad! sad
      • 45790
      • 9 Posts
      Hi people.

      I still can't get it working on a multilanguage website with babel.
      Modx 2.2.10-pl , advsearch 1.0.1-pl.

      -mbstring is enabled
      -zend libraries are installed
      -GetIds is installed
      -web context is empty, i use rucnt,encnt contexts for ru and en languages. every context have some containers with items i need to do a search between. Not a single container per context but 3 containers in every context 7,8,9 for rucnt , 33,38,39 in encnt.
      -i am trying to search according just one TV - bedrooms just for get it working

      these are the snippet calls and chunk
      [[!AdvSearch 
      &queryHook=`FilterHook`
      &ids=`[[!GetIds? &ids=`c7,c8,c9,c33,c38,c39`]]`
      &contexts=`encnt`
      &queryHook=`FilterHook`
      &includeTVs=`district,price,distance,bedrooms,market,squaremeters,object_id` 
      &withTVs=`bedrooms`
      ]]
      
      [[!AdvSearchForm? &landing=`75` &method=`GET` &help=`0` &tpl=`AdvancedSearchForm`]]
      


      FilterHook:
      <?php
      $andConditions = array(
        'tv.bedrooms:=' => 'bedrooms:request:all'
      
      );
      
      $qhDeclaration = array(
        ‘qhVersion’ => ‘1.2’,
        'andConditions' => $andConditions
      );
      
      $hook->setQueryHook($qhDeclaration);
      return true;
      
      


      AdvancedSearchForm chunk
                          <form class="advsea-search-form" id="advancedsearchform" action="[[~[[+landing]]]]" method="[[+method]]">
                                    <input type="hidden" name="id" value="[[+landing]]" />
                                    <input type="hidden" name="asId" value="[[+asId]]" />
      
                                    <label>Bedrooms
                                    <select name="bedrooms">
                                      <option value="all" selected="selected"></option>
                                      <option value="1">1</option>
                                      <option value="2">2</option>
                                      <option value="3">3</option>
                                    </select></label>
      
                                      <input type="submit" name="sub" value="[[%advsearch.search? &namespace=`advsearch` &topic=`default`]]" />
                                      <!-- <input type="submit" id="findbutton" name="findbutton" value="Search"> -->
              		</form>
      [[+resultsWindow]]
      


      It outputs nothing. No matter how i try. With/without &contects, with/without &ids options.

      But when i place some items inside an empty 'web' contexts and clear all the snippet options (just use [[!AdvSearch]] and [[!AdvSearchForm]] ). It shows these objects, but without filtering. Just outputs all the objects i placen inside a web context. That's because snippet caals doesn't contain &queryHook option. Whenever i try to use any options on snippet calls, it starts output nothing.

      And i cant understand why we should use &ids option. As it mentioned in documentation - it allows to eclude documents from being searchrd. I don't need to exlude any document from search results. Should i list documents from opposite context here and do not list current context documents?

      And, for the future use, where i should place the landing page? Should i create an independent landing page for every context?

      PS: I saw this example (http://www.revo.wangba.fr/multi-languages.html). It didn't lead me anywhere. Its mainly about how to traslate the Form. And i need just to get thinks working at first.
        • 45790
        • 9 Posts
        If i use bare snippetcall like
        {code}
        [[!AdvSearch ]]
        {code}
        it searches in default web context. If search fails, it outputs 'There were no search results...'. So it looks working.

        Whenever I add any option to advsearch snippetcall, either &queryHook or &contexts or &ids, it outputs nothing. No errors, no messages, nothing. It should be a php error somewhere but nginx error logs show no errors. How to digg it?

        I need it to get working on a multicontext website or find another multicontext search engine.
          • 45790
          • 9 Posts
          If i use bare snippetcall like
          [[!AdvSearch ]]
          

          it searches in default web context. If search fails, it outputs 'There were no search results...'. So it looks working.

          Whenever I add any option to advsearch snippetcall, either &queryHook or &contexts or &ids, it outputs nothing. No errors, no messages, nothing. It should be a php error somewhere but nginx error logs show no errors. How to digg it?

          I need it to get working on a multicontext website or find another multicontext search engine.
            • 42541
            • 18 Posts
            Hi all,

            I know it's old post but problem is in getIds snippet. It takes actual default context, and doesn`t have option to change or choose content. You need to edit snippet code. Check this.
            https://docs.modx.com/revolution/2.x/developing-in-modx/other-development-resources/class-reference/modx/modx.getchildids