So I am trying to add widgets to all other pages by following the doc. But its not working.
The mysite/code/Page.php looks like this...
class Page extends SiteTree {
static $db = array(
);
static $has_one = array(
"Sidebar" => "WidgetArea",
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Widgets", new WidgetAreaEditor("Sidebar"));
return $fields;
}
}
But I find this a little confusing...
Then in your Template you need to call $SideBar whereever you want to render the widget
themes/myThemeName/templates/Includes/Sidebar.ss
$Sidebar
Ive tried adding $Sidebar in several places, and I have done the db/build, but its still not showing the sidebar. I did remove the sidebar from the blog too, as to avoid a double up as recommended.
Thanks in advance,
Andy