Hi, i wish see the widgets (links, countdown, etc) in the home page but only can see after press the blog link.
?¿
help me please
thanks
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Hi, i wish see the widgets (links, countdown, etc) in the home page but only can see after press the blog link.
?¿
help me please
thanks
You can have widgets on any page type by adding a WidgetArea to it. Open the page type code and add
static $has_one = array(
"MyWidgets" => "WidgetArea"
);
then in the getCMSFields you will need to add the widget drag and drop system
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Widgets", new WidgetAreaEditor("MyWidgets"));
return $fields;
}
Then last but not least you need to open up your template file and add the code to render the widget area. In this example you would need to put $MyWidgets in the template some where.
Remember to db/build and then flush the page.
Ok, but where is "page type"??
explain me please
thanks
Rather then explain and give you the full solution its probably better if you actually read tutorial 1 and 2 - http://doc.silverstripe.com/doku.php?id=tutorials and get to under stand the basics first, Tutorial 2 should cover what you need to know for this.