17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1632 Views |
-
add new CMS fields to search

6 December 2007 at 12:37pm Last edited: 6 December 2007 3:10pm
Hi,
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).
Cheers!
Anatol -
Re: add new CMS fields to search

3 March 2008 at 11:30am
I'm interest in knowing how too! Any solution ?
-
Re: add new CMS fields to search

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.
| 1632 Views | ||
|
Page:
1
|
Go to Top |


