762 Posts in 312 Topics by 291 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 742 Views |
-
Getting Widgets in SS Admin to work on other pages

6 March 2011 at 3:53pm
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.
-
Re: Getting Widgets in SS Admin to work on other pages

6 March 2011 at 10:52pm
Hi,
Read this... http://doc.silverstripe.org/sapphire/en/topics/widgets#adding-widgets-to-other-pages
You will find everything you need there. -
Re: Getting Widgets in SS Admin to work on other pages

7 March 2011 at 5:43am
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?
-
Re: Getting Widgets in SS Admin to work on other pages

7 March 2011 at 9:01am Last edited: 7 March 2011 9:03am
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?
| 742 Views | ||
|
Page:
1
|
Go to Top |

