What version of MODx is available in view of ? 0.9.6.1 or 0.9.7 ?
An "onBeforeSearch" event then, passing the search term, that allows the user to create a custom pre-processor for the search term.
With ajaxSearch 1.7, the filtering is taking place in the stripSnip function from the includes/ajaxSearch.inc.php file.
I am interested by an extract of your document in order to understand why the filtering doesn’t fit as awaited. In advance thanks for this feedback.
[!Ditto? &parents=`115` &depth=`1` &hideFolders=`1` &sortBy=`pub_date` &display=`4` &paginate=`1` &paginateAlwaysShowLinks=`1` &filter=`archiveDate,@EVAL return date('d-m-Y');,4`!]At the same time.
My comment was just the clarification of an idea put forward in an earlier post. It does not exist.
<?php
$text = "[!Ditto? &parents=`115` &depth=`1` &hideFolders=`1` &sortBy=`pub_date` &display=`4` &paginate=`1` &paginateAlwaysShowLinks=`1` &filter=`archiveDate,@EVAL return date('d-m-Y');,4`!]";
$text = stripSnip($text);
echo "text->".$text."<-";
function stripSnip($text){
// Regular expressions of things to remove from search string
$modRegExArray[] = '~\[\[(.*?)\]\]~'; // [[snippets]]
$modRegExArray[] = '~\[!(.*?)!\]~'; // [!noCacheSnippets!]
$modRegExArray[] = '!\[\~(.*?)\~\]!is'; // [~links~]
$modRegExArray[] = '~\[\((.*?)\)\]~'; // [(settings)]
$modRegExArray[] = '~{{(.*?)}}~'; // {{chunks}}
$modRegExArray[] = '~\[\*(.*?)\*\]~'; // [*attributes*]
// Remove modx sensitive tags
foreach ($modRegExArray as $mReg)$text = preg_replace($mReg,'',$text);
return $text;
}
?>text-><-So, I get as awaited an empty value for $text. The content inside the brackets is cleared as needed.
So I don’t know How I could investigate on your issue. Are you sure that the stripSnip function is called ? Have you set the parameter &stripSnip to 0 in your AjaxSearch Snippet Call ? Could you check the value of this parameter by looking to the code of your page. And could you give me the AjaxSearch snippet call. Thanks.
[!ajaxSearch? &AS_showForm=`1` &ajaxSearch=`0` &highlightResult=`0` &parents=`48,62,63,64` &AS_landing=`8`!]
This discussion is closed to further replies. Keep calm and carry on.