We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28338
    • 46 Posts
    Two more things.

    1. When AjaxSearch finds something in a TV, it doesn’t show an extract in the search result. I don’t know if it’s a bug or if it’s just tricky to implement.

    2. Is there any way to add some kind of breadcrumb to each search match so that one can easily understand in what part of the website the match is located? I would LOVE a feature like this.

    I just hope that none of these ideas are as impossible as my other ideas smiley
      • 5811
      • 1,717 Posts
      As i am not sure to understand your request regarding breadcrumb, i explain what i understand ... huh

      You would like to have for each search terms found, the document path where the search term is located.

      Instead to have Title of document (as link), description and part of content with the search term highlighted, you would like breadcrumb (document path as link), description and and part of content with the search term highlighted.

      Is it correct ?

      If yes, i look at the parameters of the breadcrumbs snippet and some of his parameters seems to be relevant for your request :

      // $maxCrumbs [number]
      // Max number of elements to have in a path.
      // 100 is an arbitrary high number.
      // If you make it smaller, like say 2, but if you are 5 levels deep, it will appear as:
      // Home > ... > Level 4 > Level 5
      // It should be noted that "Home" and the current page do not count. Each of these are configured
      // separately.

      // $pathThruUnPub [ 1 | 0 ]
      // When your path includes an unpublished folder, setting this to 1 will show all documents in path EXCEPT the unpublished.
      // Example path (unpublished in caps)
      // home > news > CURRENT > SPORTS > skiiing > article
      // $pathThruUnPub = true would give you this:
      // home > news > skiiing > article
      // $pathThruUnPub = false would give you this:
      // home > skiiing > article (assuming you have home crumb turned on)

      // $respectHidemenu [ 1 | 0 ]
      // Setting this to 1 will hide items in the breadcrumb list that are set to be hidden in menus.

      // $showHomeCrumb [ 1 | 0 ]
      // Would you like your crumb string to start with a link to home? Some would not because
      // a home link is usually found in the site logo or elsewhere in the navigation scheme.;

      // $crumbSeparator [string]
      // Define what you want between the crumbs
      // default = ’/’

      Do you think that these parameters could be usefull or not ? Let me know ?
      Not sure to implement your request but i could study it
        • 28338
        • 46 Posts
        You’re kind of correct. I don’t know if replacing the title of tha matching document with a breadcrumb. I’ve attached a png of what I had in mind.

        The parameters do indeed seem relevant.
          • 20508
          • 157 Posts
          Hello,

          I’m integrating this great AjaxSearch into a MODx Website. I would like only the content within th blog to be search and my snippet call looks like this: [!AjaxSearch? &parents=`24`!] with "24" as the ID of the parent blog folder.

          AjaxSearch still returns results based on the site as a whole, not just the blog. Is there something I’m missing?

          Cheers,
          msflux
            • 20508
            • 157 Posts
            Hello,

            I also just noticed that the search results box (ajaxSearch_output), is visible upon first entering the page. I removed the reference to the inline opacity as it wasn’t validating - which I think now accounts for this. However, before even with this reference left in tact, the box was covering the first blog post - although you couldn’t see it - but you couldn’t click on the blog post because there was this DIV on top of it.

            Is there any way to get this working correctly? Here’s a link to the blog/site using AjaxSearch: http://stirboston.com/index.php?q=blog

            msflux
              • 5811
              • 1,717 Posts
              Regarding your first post. Which version of ajaxSearch do you use. When i look to your code, it seems to be the 1.6.1 version. If it is true, is it normal that the document selection don’t work grin This feature is provided only with the version 1.6.2 and upper. Download the code at http://modxcms.com/forums/index.php/topic,19755.0.html
              (2nd post)

              About your second post :
              The code line :
               $finalResults = '<div id="ajaxSearch_output" style="opacity:0;filter:alpha(opacity=0);-moz-opacity:0.;" > </div>';
              in the snippet is mandatory to create the output div.
              Look at http://www.wangba.fr/accueil_livres_voyage.html to find an example. Look at the code source before to try a search and look at the search.css stylesheet. You can try "année" as search term to see the results.
              The ajaxSearch_output div should be present when the ajax request occurs to catch the results

              The use of the opcity style was the only solution that i found for a correct behaviour with FF, IE and Opera
                • 727
                • 502 Posts
                I am stuck trying to get the search results page working. Here is my call:

                [!AjaxSearch? &showMoreResults=`1`&moreResultsPage=`27`&AS_showResults=`0`&AS_landing=`27`&ajaxMax='2'!]


                When I type in a search term I get two results and a link to more results. I click on that and it takes me to page ID 27. However only the search form is being displayed on page ID 27 - no results. I have tried all kinds of combinations of snippet calls on page 27, and all they do is show the search form.

                I have tried page ID 27 cached and uncached, and the snippet call cached and uncached as well.

                Here is the URL being used (domain name changed):

                http://www.test.com/index.php?id=27&AS_search=link


                I am using the AjaxSearch in 0.9.6.1. Any ideas?

                Andy
                  • 727
                  • 502 Posts
                  OK, how about this:

                  Can someone please post a known working pair of snippets for AjaxSearch? The first is the search form with a link to more results. The second goes on the more results page and shows all results? Thanks.

                  Andy
                    • 5811
                    • 1,717 Posts
                    Hi Andy,

                    To get the results on your result page, this page should contain the following call:
                    [!AjaxSearch? &ajaxSearch=`0` &AS_showForm=`0`!]

                    &ajaxSearch=0 means write the results on this page, not in an ajax window

                    &AS_showForm=0 avoids to output the search form on the result pages

                    If you look at the snippet code, you can see at the end of the snippet file, these code lines :
                    if ($ajaxSearch) {
                        $finalResults = '<div id="ajaxSearch_output" style="opacity:0;"> </div>';
                    	$introMessage = '';
                    }

                    As by default ajaxSearch=`1`, if you forget to add &ajaxSearch=0 in your call, then you overwrite the correct results by
                    ’<div id="ajaxSearch_output" style="opacity:0;"> </div>’. grin

                    Check your html code under your browser, you probably find somewhere :
                    ’<div id="ajaxSearch_output" style="opacity:0;"> </div>’

                    Regarding the ajaxSearch snippet call in your template:
                    [!AjaxSearch? &showMoreResults=`1` &moreResultsPage=`27` &AS_showResults=`0` &AS_landing=`27` &ajaxMax='2'!]

                    &AS_landing=`27` is usefull only when &ajaxSearch=`0`. So useless here.
                    &AS_showResults=`0` means "do not show the results" when the non-ajax mode is on. useless too.

                    Try :
                    [!AjaxSearch? &showMoreResults=`1` &moreResultsPage=`27` &ajaxMax='2'!]

                    And if you would like highligths the terms found, install the Ajaxsearch plugin and use:
                    [!AjaxSearch? &showMoreResults=`1` &moreResultsPage=`27` &extract=`1` &ajaxMax=`2`!]

                    The snippet call of http://www.wangba.fr/accueil_livres_voyage.html is :
                    [!AjaxSearch? &language=`francais-utf8` &AS_opacity=`0.9` &parents=`28` &moreResultsPage=`33` &extract=`1` &showMoreResults=`1` &ajaxMax=`5`!]

                    Take care, AS_opacity and parents works only with the 1.6.2 version - see below.

                    and the page moreResults 33 has the following call:
                    [!AjaxSearch? &ajaxSearch=`0` &AS_showForm=`0`!] 


                    Otherwise, be careful, the ajaxSearch version delivered with Modx 0.9.6.1 have some issues :
                    for example, if you use an accented search term, the ajax search find the terms, but if you ask for more results. It doesn’t find the others results !!!

                    So download the 1.6.2 version after the reading of the post : http://modxcms.com/forums/index.php/topic,5357.300.html

                    Let me know if you have some other issues.

                    And just for fun to finish this long post, listen this french song "Andy" from "Les Ritas Mitsouko", a famous french group. Andy dis moi oui - Andy says me yes laugh (... now it is working !!)
                      • 727
                      • 502 Posts
                      Hi Coroico,

                      Thanks! Now it works! However I upgraded to 1.6.2 and none of my pages now load. Instead I get:

                      Fatal error: Maximum execution time of 30 seconds exceeded in /data/websites/dontborrowtroubleaz.com/public_html/assets/snippets/AjaxSearch/includes/AjaxSearch.inc.php on line 325


                      It seems this is the array_merge function call. Any ideas?

                      Andy

                      This discussion is closed to further replies. Keep calm and carry on.