23379 Posts in 18298 Topics by 2867 members
|Go to End|
12 December 2009 at 11:32am
Ok, what I would like to do is automatically update the [Content] field with data from two other CMS fields called [OrphanageName] and [Gender].
This is so that these items will be searchable by the Silverstripe search module.
Any assistance would be appreciated
12 December 2009 at 8:06pm
try adding something like this to your page class:
$this->Content = $this->OrphanageName . ' ' . $this->Gender;
i didnt test the code, but it should be close... this will always overwrite Content by the way.
12 December 2009 at 11:25pm
Excellent - that works really well.
Do you also know how I can also run a search as an AND rather than an OR??
For example, if I search for Male Mynamar - I still get all females showing from Mynamar.
Any help would be great.
15 December 2009 at 4:18am
not too sure on that one.. you probably will have to extend SearchForm.. theres also an advanced search form class but i've never worked with that, so perhaps it already exists?
|Go to Top|