Skip to main content
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
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
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.
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.
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?