We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32654
    • 26 Posts
    Hi,
    I would like to know how to exclude certain pages such as sitemap, newsletter signup, etc from my Ajaxsearch results.
    I have looked through the various parameters but could not find one that seems applicable.
    I am using the AjaxSearch 1.7.1 in non-ajax mode.

    Any help appreciated

    Thanks

    w
      • 5811
      • 1,717 Posts
      For the moment it is not simple.
      I have open a feature request about that. See FS#31
        • 10449
        • 956 Posts
        Couldn’t you just append / insert something like

        if(isset($excludeDocs)) {
        $sql .= " WHERE sc.id NOT IN(’$excludeDocs’)";
        }

        somewhere? (e.g. &excludeDocs=`5,23,56,234`)
          • 32654
          • 26 Posts
          ganeshXL

          Thanks for the info. Being just a beginner at this still I added the &excludeDocs=`70,76,78` suggestion into the AjaxSearch call string on the results page? But not sure how to add or where your:

          if(isset($excludeDocs)) {
          $sql .= " WHERE sc.id NOT IN(’$excludeDocs’)";
          }

          in the AjaxSearch 1.7.1 snippet.

          Thanks
          w
            • 5811
            • 1,717 Posts
            World, the suggestion of GaneshXL is good but it’s not so simple sad

            If you add a new parameter in the snippet call, you need to get and check it in the ajaxSearch/includes/snippet.ajaxSearch.inc.php file and then add a new parameter in the call of the doSearch function and then change the sql order. And for the ajax part you need to send a new parameter to the js pgm.

            As I am mainly busy with the next 0.9.6.2 version of MODx, I haven’t enougth time at the moment to developp and test this new feature.