Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Blog Sidebar goes Missing, WHERES IT GONE?


Reply

1114 Views

Avatar
Jarrow

18 December 2009 at 1:19am Community Member, 4 Posts

I followed the instructions @ http://doc.silverstripe.org/doku.php?id=widgets on how to install a widget on other pages. So in page.php I changed:
...............................................................................................
class Page extends SiteTree {
   public static $db = array(
   );
   public static $has_one = array(
   );   
}
...............................................................................................

to

...............................................................................................
class Page extends SiteTree {
   public static $db = array(
   );   
    static $has_one = array(
   "Sidebar" => "WidgetArea",
);   
function getCMSFields() {
   $fields = parent::getCMSFields();
   $fields->addFieldToTab("Root.Content.Widgets", new WidgetAreaEditor("Sidebar"));
   return $fields;
}
}
...............................................................................................

This works and I am able to add widgets on pages by using $Sidebar but the blog widgets have now dissapeared? Any ideas anyone?