17488 Posts in 4473 Topics by 1978 members
|Go to End|
6 December 2007 at 12:37pm Last edited: 6 December 2007 3:10pm
Is it possible to add a new field in the CMS (by overloading getCMSFields()) to the search?
E.g. I created a new field ContentMore:
$fields->addFieldToTab("Root.Content.Main", new HtmlEditorField("ContentMore", "More", 10));
but it seems the default Silverstripe search searches only in the "Content" field (or maybe the standard fields).
3 March 2008 at 11:30am
I'm interest in knowing how too! Any solution ?
3 March 2008 at 12:09pm
Yes, this is possible, but not really evident.
You have to either extend the SearchForm class ( sapphire/search/SearchForm.php) or modify the file itself.
Basically you'll have to add the fields to the $queryContent->select of the searchengine method, but be carefull you don't make it crash on it, as your custom fields probably won't be available on every page.
|Go to Top|