We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25551 ☆ A M B ☆
    • 1,231 Posts
    Quote from: coroico at Jun 22, 2008, 06:25 PM

    @Rosco
    I got the same issue with the same ajaxSearch Call. I have changed the way of writing the javascript variables. Infortunately with false, you get idgrp= in your javascript header. To solve that, in the snippet line 175 and line 178 change the "true" by ’’ (2 simples quotes).

    // IDs of documents to retrieve their children to &depth depth  where to do the search
    $cfg['parents'] = isset($parents) ? $parents : (isset($__parents) ? $__parents : '');
     
    // IDs of documents where to do the search
    $cfg['documents'] = isset($documents) ? $documents : (isset($__documents) ? $__documents : '');


    I will check the others parameters initialized with boolean.

    On my snippet it’s on lines 167 and 170. Could you verify that the latest version of AS is uploaded or you may of gotten the lines wrong? Just incase there is a wrong file version that’s causing issues as this isn’t helping.... Still just reloading the homepage with no search. Cheers.

    Ross
      Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
      AugmentBLU - MODX Partner

      BLUcart - MODX Revolution E-Commerce & Shopping Cart
      • 5811
      • 1,717 Posts
      @Rosco

      You are right. These changes should take place lines 167 (&parents) and 170 (&documents)

      I give you wrong line number because I check on the version 1.8 beta1 in preparation. But I have added a new parameter &whereSearch. (in which tables do the search: content,tv,jot,maxigallery,your own tables). This explain the differences in line number.
        • 25551 ☆ A M B ☆
        • 1,231 Posts
        Ok, could you tell me what I should be doing to try and get the search working again?

        If you go to my site you will see the AS info is in the head of the documents but the search is not working?

        Ross
          Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
          AugmentBLU - MODX Partner

          BLUcart - MODX Revolution E-Commerce & Shopping Cart
          • 5811
          • 1,717 Posts
          @Roscco. I have checked your javascript variables. They are now all correct.

          But you get the javascrit error Window.onDomReady is not a function because you haven’t load the mootools library sad
          I haven’t see this issue on my site because I load mootools with others snippets (Quickedit)

          In ajaxSearch/classes/ajaxSearch.class.inc.php line 104. Could you replace the code line :
                if ($addJscript) {
          by
                if ($this->cfg['addJscript']) {
          This correction will load the mootools library correctly. This issue comes from the objectification of the previous code.
            • 5811
            • 1,717 Posts
            @Rasc
            I often use a navigation with a main navigation item (e.g. Contact) and subpages (Contact form, How to reach us, Legal information). The main item/document is empty, containing only the firstChildRedirect snippet but acting as a menu item. Clicking this contact menu item user will be redirected to the contact form document (the first child).
            With the same logic (one main item and redirection to the first menu item) I use a link rather a document. Look at the image below, this a screen cast of the folder hierarchy of the ajaxSearch demo site.

            When you click on ajaxSearch mode test (#142), you go directly on the first menu item (base #143). Is this solution solve your request ?
              • 25551 ☆ A M B ☆
              • 1,231 Posts
              Ok I just done the edit and still there is an error.

              Window.onDomReady is not a function
              [Break on this error] Window.onDomReady(activateSearch); ajaxSearch.js (line 230)

              I stripped all the other snippets and JS from the page to make sure again that there is no compatibility problems with jquery etc and it’s still not working. shocked

              Ross
                Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                AugmentBLU - MODX Partner

                BLUcart - MODX Revolution E-Commerce & Shopping Cart
                • 5811
                • 1,717 Posts
                @Rosco. Do you have updated your site on line ? I don’t see the mootools library loaded in your header. Could you confirm (or not) if you have loaded the mootools library ?
                  • 25551 ☆ A M B ☆
                  • 1,231 Posts
                  Do you have to link to the mootools library manually? I thought that would of been done via the snippet?

                  I’ll add the link to the library manually to see if the snippet works.

                  grin

                  Ok I added it manually and it never worked.... I then took out alot of the extra JS and snippets and it’s working now. So I think there is a conflict, most likely with jquery.


                  EDIT: Yeah Jquery is stopping it from working! I guess I better do the $ no conflict thing

                  EDIT AGAIN : I already have the var $j = jQuery.noConflict(); running in my jquery script but it’s not stopping the conflict. DOH!
                    Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                    AugmentBLU - MODX Partner

                    BLUcart - MODX Revolution E-Commerce & Shopping Cart
                    • 5811
                    • 1,717 Posts
                    No, by default, AS load automatically the mootools library, except if you use &addJscript=`0` in your call snippet.
                    I will do a new test starting with a new Modx environment. I coming back to you later.
                      • 5811
                      • 1,717 Posts
                      @Rossco
                      Replace addJscript by $this->cfg[’addJscript’] is not enougth tongue To load the mootools library change too in ajaxSearch/classes/ajaxSearch.class.inc.php line 105 and replace :
                              $modx->regClientStartupScript($jsMooTools);
                      by
                              $modx->regClientStartupScript($this->cfg['jsMooTools']);

                      Sorry for all these issues ..