I want the visitor also to be able to search for webusers.
Another problem was the snippet only searched page-content or users, not both at the same time.
Is there an easy whay to do this,
To customize ajaxSearch to do a search in the webuser table you should redefine the search by using the whereSearch parameter. Something like &whereSearch=`webusers` &config=`webusersCfg
with the webusersCfg file content:
<?php
function webusers(& $main,& $joined, $listIDs){
$main = array(
'tb_name' => "modx_web_users",
'tb_alias' => 'mwu',
'id' => 'id',
'searchable' => array('username'),
'displayed' => array('username'),
'date' =>array(),
'filters' => array(),
'jfilters' => array()
);
$main['filters'][]= array();
$main['filters'][]= array();
$joined = NULL;
}
?>`With this, you couldn’t, in the same search, do a search in the web_users table and in the document content.
You couldn’t because it doesn’t exist a link between a document and a web user.
But if needed you could the
subSearch to set up a form which allow a search in documents or in web users list.
See:
http://www.modx.wangba.fr/index.php?id=264 for subSearch
See:
http://modxcms.com/forums/index.php/topic,34002.msg207346.html#msg207346 as example for a search in a wordpress table