Jump to:

23490 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Blog Sidebar goes Missing, WHERES IT GONE?

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

Page: 1
Go to End
Author Topic: 1107 Views
  • Jarrow
    Avatar
    Community Member
    4 Posts

    Blog Sidebar goes Missing, WHERES IT GONE? Link to this post

    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?

    1107 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.