We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8416
    • 173 Posts
    Hi,
    I can’t get the &parents parameter to work for the AjaxSearch snippet. It is just being ignored. I want to narrow down my search for the children of document `53`.
    Here is my snippet call. Is there something wrong? Am I missing something obvious?
    [!AjaxSearch? &parents=`53` &depth=`3` &ajaxSearch=`1` &AS_landing=`53` &moreResultsPage=`53` &showMoreResults=`1` &addJscript=`0` &extract=`0` &AS_showResults=`0` &grabMax=`7` !]
    

    In the document 53 (landing results document) I have
    [!AjaxSearch? &AS_showForm=`0` &ajaxSearch=`0` !] 
    

    Thank you.
      • 5811
      • 1,717 Posts
      I have done a test on my site with your snippet call and my search is correctly limited to the children documents of the &parents parameter.
      Could you precise which documents are found outside of the limited search area. Are they in the tree but deeper than the third level or outside of the tree ?

      Otherwise could you try a more simple test like:
      [!AjaxSearch? &parents=`53` &depth=`3` &ajaxSearch=`1` &moreResultsPage=`53` &showMoreResults=`1` &addJscript=`0` &extract=`0` &grabMax=`7` !] to use only ajasearch mode parameters.

      Let me know the results.
        • 8416
        • 173 Posts
        Thanks, I tried your snippet to no avail. I have my search snippet defined in a template and I use the template for the document `53`. The search results returned are global to my tree document structure.

        I have the following structure

        Root
        -->54
        -->53
        ----> 369
        ----------> 454
        -------------> 370
        -------------> 371
        If I run a search document `54` will also be searched, but I want only 369, 454,370 and 371.
        Thanks for following up...
          • 8416
          • 173 Posts
          silly me.... I was using 1.6. I upgraded to AjaxSearch - version 1.7 and everything works fine now...
          Thanks for your time
            • 5811
            • 1,717 Posts
            It doesn’t matter. I add a new english word to my vocabulary : silly wink
              • 8416
              • 173 Posts
              Hello,
              I’m using the ajax request to load the results into the box below the search form. I styled it using #ajaxSearch_output; everything looks good on most of the browser. However under IE 7/6, the first time the search form is displayed, an empty result box is displayed under the search form. Is there a way to get rid of it the first time the search form is displayed?

              Thank you.

              Eric
                • 5811
                • 1,717 Posts
                Hi Eric,

                Have you a web site address that i can check ? If Not, could you on your local site, check your code. With the rigth button anywhere on the first page where appears the form ajaxSearch, look at the source code of the page. You should find a code line like:
                <div id="ajaxSearch_output" style="opacity:0;filter:alpha(opacity=0);-moz-opacity:0.;" > </div>
                This code line specifies 3 differents styles for opacity. opacity:0; for FF, alpha(opacity=0); for IE and -moz-opacity:0.; for Netscape. If you haven’t this line, this explains the reasons of your empty div with IE.
                  • 8416
                  • 173 Posts
                  Hi
                  Sorry, I’m only running locally for now.

                  <div>                   
                          <form id="ajaxSearch_form" action="accommodations/" method="post">
                    		         <label for="search_caption">
                  			        <span id="search_caption">Search:</span><a name="search"></a>
                  			</label>
                  			<label for="ajaxSearch_input">
                  				<input id="ajaxSearch_input" type="text" name="search" value="Enter text here..." onfocus="this.value=(this.value=='Enter text here...')? '' : this.value ;" />
                  			</label>
                  			<label for="ajaxSearch_submit">
                  				<input id="ajaxSearch_submit" type="image" src="/testSite/assets/snippets/ajaxSearch/images/search_glass.gif" name="sub" value="Go!" alt="Search";/> 
                  			</label>
                  		</form>
                    
                    <div id="ajaxSearch_output" style="opacity:0;filter:alpha(opacity=0);-moz-opacity:0.;" > </div>   
                  </div> 
                  


                  I do have the filter statement for IE. Once I run a search and click on the "cross" image, the div disappear. Could I force a refresh the first time the page is loaded?
                  Thanks again
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    I had this once... darn, can’t remember exactly what I did, but it was a styling issue. I have got to start making notes of all this stupid IE stuff I run into!
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org
                      • 8416
                      • 173 Posts
                      Hi Susan,
                      If you could remember you’ll make an happy fellow smiley
                      Thanks