This is an old thread, but I just want to throw my solution here, because google gets this first.
Let say this is a new snippet called "
fixedSimpleSearch", that will wrap SimpleSearch.
<?php
$memberIds = $modx->getOption('memberIds', $scriptProperties);
if (empty($memberIds)) {
$memberIds = array();
} else {
$memberIds = array_map('trim', @explode(',', $memberIds));
}
$ids = $modx->getOption('ids', $scriptProperties);
$isMember = $modx->user->isMember('Administrator', 'Editor', 'Member');
if (!empty($ids)) {
$ids = array_map('trim', @explode(',', $ids));
if ($isMember) {
$ids = array_merge($ids, $memberIds);
}
$scriptProperties['ids'] = @implode(',', $ids);
}
$output = $modx->runSnippet('SimpleSearch', $scriptProperties);
return $output;
Your snippet call would be just the same, because this snippet passes over the $scriptProperties to SimpleSearch
[[!fixedSimpleSearch?
&idType=`parents`
&ids=`1,2,3,4,5`
&memberIds=`6,7,8,9`
&highlightTag=`strong`
&pageLimit=`3`
&tpl=`SimpleSearch_tpl`
&containerTpl=`SimpleSearch_containerTpl`
&pagingSeparator=``
&pageTpl=`SimpleSearch_pageTpl`
¤tPageTpl=`SimpleSearch_currentPageTpl`
]]
The new snippet appends the
memberIds (resources for member) when the user is logged in.
memberIds IS NOT SimpleSearch's property.
Hope you can get the idea.