Hi, I'm setting up a bookshop and adding the custom fields "Subtitle" and "Authors" to the default search by putting them into the MetaDescription using the onBeforeWrite method. This works great on Text fields...
public function onBeforeWrite() {
parent::onBeforeWrite();
$Text1 = $this->getField('Subtitle');
$Text2 = $this->getField('Authors');
$this->setField('MetaDescription',"{$Text1} by {$Text2}");
}
But the problem is that my "Authors" field is actually a many_many 'TagField' :
static $many_many = array(
'Authors' => 'Author',
So the onBeforeWrite code above works great for the Subtitle but doesn't work for the Authors. Any idea how I could get this to work?
Because the 'TagField' is actually an extension of a standard Text field and because it's onBEFOREWrite is there a way I could just grab whatever text is in that field - I don't need to know if it's a existing author or match it to a data object or anything. ?