Hi,
I am working on a homepage template where a default value should be set when HTMLEditor field X is empty or when a day is passed and the HTMLEditor field X is not filled out with a new value.
I want to update the homepage every day with a daily menu. But it might occur that I forget to set the menu and because the daily menu changes every day I want to replace the menu with the opening times of the restaurant.
I am no php specialist so any help with this is appreciated. What do I need to alter to achieve this?
<?php
class HomePage extends Page {
static $db = array(
'Sidetext' => 'HTMLText'
);
public function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Main', new HTMLEditorField('Sidetext'), 'Content');
return $fields;
}
}
class HomePage_Controller extends Page_Controller {
}
Thank you in advance,
Wesley