Advanced Search Question

3 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: March 9, 2010   (RSS)

Re: [InHouse] Advanced Search Question

By Dave - March 8, 2010

Hi Jayme,

It doesn't do that, but I made it do it now. Try this:

- open /lib/menus/default/list_functions.php
- search for: get fieldschema
- Add the code in red:
// get fieldschema for single field searches:
$fieldSchema = @$schema[ $fieldnames[0] ];
if ($fieldSchema) { $fieldSchema['name'] = $fieldnames[0]; }

// special case: add createdBy.fieldname search functionality
if (preg_match("/^createdBy\.(.*?)$/i", $fieldsAsCSV, $matches)) {
$name = 'createdByUserNum_match';
$lastValue = @$_REQUEST[$name];
$displayAs = 'dropdown';
$fieldSchema = array(
'name' => '_not_used_',
'optionsType' => 'table',
'optionsTablename' => 'accounts',
'optionsValueField' => 'num',
'optionsLabelField' => $matches[1],
);
}


- Go to: Admin > Section Editors > Your Section > Searching (Tab)
- Add this to add a search fields by user: Name|createdBy.fullname

Hope that helps! Let me know if that works for you. :)
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Advanced Search Question

By InHouse - March 9, 2010

Works perfectly Dave! A very useful new feature.

You genius remains unsurpassed - but that Chris guy might give you a run for your money now and then. ;-)

J.