I've followed the instructions for adding widgets to other pages but unable to have it show in the Widgets tab as it show in the Blog. Any suggestions to make it active on all other pages, current and future? I'd like to have drag & drop the same way it is on the blog.
We've moved the forum!
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,
Read this... http://doc.silverstripe.org/sapphire/en/topics/widgets#adding-widgets-to-other-pages
You will find everything you need there.
I've read and done the instructions on that page. Widgets shows as a tab in the SS CMS Admin page for the blog page but not on any other page. How do I get it to show as a tab along with "Main", "Metadata" and "Google Sitemap" in the same drop & drag format as the blog page edit?
sounds like you have missed one of these bits...
First step is to add an WidgetArea to the Database to store the widget details. Then you have to edit the CMS to add a Widget Form to manage the widgets. An example of this is below
** mysite/code/Page.php **
class Page extends SiteTree {
...
static $has_one = array(
"Sidebar" => "WidgetArea",
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Widgets", new WidgetAreaEditor("Sidebar"));
return $fields;
}
....
}
or
Then in your Template you need to call $SideBar whereever you want to render the widget
Eg for blackcandy I put this above the closing </div>
** themes/myThemeName/templates/Includes/Sidebar.ss **
$Sidebar
or
you needed to do a dev/build?