I've followed the documentation regarding adding widgets to non-blog pages (http://doc.silverstripe.org/doku.php?id=widgets). I want to add widgets to the base Page class, so I opened mysite/code/Page.php and added:
public static $has_one = array(
"Linkarea" => "Pagewidgets"
);
Also added:
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Widgets", new WidgetAreaEditor("Pagewidgets"));
return $fields;
}
I run /dev/build?flush=1 and I see this in the output:
# Table Page: created
# Field Page.ID: created as int(11) not null auto_increment
# Field Page.PagewidgetsID: created as int(11) not null default '0'
# Index Page.PagewidgetsID: created as (PagewidgetsID)
# Table Page_Live: created
# Field Page_Live.ID: created as int(11) not null auto_increment
# Field Page_Live.PagewidgetsID: created as int(11) not null default '0'
# Index Page_Live.PagewidgetsID: created as (PagewidgetsID)
# Table Page_versions: created
# Field Page_versions.ID: created as int(11) not null auto_increment
# Field Page_versions.RecordID: created as int(11) not null default '0'
# Field Page_versions.Version: created as int(11) not null default '0'
# Field Page_versions.WasPublished: created as tinyint(1) unsigned not null default '0'
# Field Page_versions.AuthorID: created as int(11) not null default '0'
# Field Page_versions.PublisherID: created as int(11) not null default '0'
# Field Page_versions.PagewidgetsID: created as int(11) not null default '0'
# Index Page_versions.RecordID_Version: created as (RecordID,Version)
# Index Page_versions.RecordID: created as (RecordID)
# Index Page_versions.Version: created as (Version)
# Index Page_versions.AuthorID: created as (AuthorID)
# Index Page_versions.PublisherID: created as (PublisherID)
# Index Page_versions.PagewidgetsID: created as (PagewidgetsID)
This is what I would expect. However, when I log in to the admin area and click on one of the cms pages, I expect to see a new Widget tab at the same level as the Main and Metadata tabs under Content, but it's not there. Is there supposed to be a new tab there to manage Widgets on each page?
I'm new SilverStripe, so maybe I'm missing something. Any help is appreciated.