I found no more spelling mistakes
in Page.php is this code
function GetSidebar() {
return DataObject::get_one("SidebarPage");
}
the code is in the class class Page_Controller extends ContentController {}
then.. in my SideBarPage.php is this code
<?php
class SidebarPage extends Page {
static $db = array(
'SidebarText' => Text;
);
static $has_one = array(
'Image1' => 'Image',
'Image2' => 'Image',
'Image3' => 'Image',
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Main', new TextAreaField('SidebarText'), 'Content');
$fields->addFieldToTab("Root.Content.Images", new ImageField('Image1'),'Content');
$fields->addFieldToTab("Root.Content.Images", new ImageField('Image2'),'Content');
$fields->addFieldToTab("Root.Content.Images", new ImageField('Image3'),'Content');
return $fields;
}
}
class SidebarPage_Controller extends Page_Controller{
}
?>
and in themes/my_template/templates/Includes/SideBar.ss is
<% control GetSidebar %>
$SidebarText
$Image1
$Image2
$Image3
<% end_control %>
and lastly in my Page.ss is
<% include Sidebar %>
I hope I forgot nothing.