Hi, on our site's HomePage we have a custom DataObject called a "HomePageTab" which is just a little container with 3 news items in it. The problem is that editing these tabs in a draft will alter the tab on the published page as well. Our editors want to be able to see how the tabs look in a draft before publishing them.
I've tried adding this to HomePageTab but it didn't seem to help:
static $extensions = array(
"Versioned('Stage', 'Live')"
);
I've also tried moving HomePage's "has_many HomePageTab" into "has_one HomePageTab" but that just breaks the page.
I'm probably missing something incredibly obvious here, so apologies. It's my first post :o]
Here are the relevant bits of HomePage and HomePageTab (I think):
class HomePage extends Page {
static $allowed_children = array(
'HomePageTab',
'Tag',
'PopularDocument',
);
static $has_one = array(
);
static $has_many = array(
'Tabs' => 'HomePageTab',
'TagCloud' => 'Tag',
'PopularDocuments' => 'PopularDocument',
);
}
class HomePageTab extends DataObject {
static $db = array(
'Title' => 'Varchar',
'ColumnOneText' => 'Varchar(255)',
'ColumnTwoText' => 'Varchar(255)',
'ColumnThreeText' => 'Varchar(255)',
'ColumnOneLink' => 'Varchar(255)',
'ColumnTwoLink' => 'Varchar(255)',
'ColumnThreeLink' => 'Varchar(255)',
'ColumnOneLinkTarget' => "Enum('_parent, _blank','_parent')",
'ColumnTwoLinkTarget' => "Enum('_parent, _blank','_parent')",
'ColumnThreeLinkTarget' => "Enum('_parent, _blank','_parent')",
);
static $has_one = array(
'HomePage' => 'HomePage',
'ColumnOneImage' => 'Image',
'ColumnTwoImage' => 'Image',
'ColumnThreeImage' => 'Image',
);
}