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.

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.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

admin: blog has twice the number of widgets.


Go to End


4 Posts   2048 Views

Avatar
raamklaza

Community Member, 182 Posts

8 November 2008 at 8:50am

In the blog i see the widgets double.

I used the documentation of silverstripe to add widgets to all the normal pages, but now it's double for the blog page because it's already in their.

How can i solve this? Where in the blog can i take this out?

Avatar
raamklaza

Community Member, 182 Posts

8 November 2008 at 8:51am

In the admin section i mean :)

Avatar
Invader_Zim

Community Member, 141 Posts

11 November 2008 at 12:09am

Edited: 11/11/2008 12:11am

Hi,

to remove the duplicate widgets in your blog you have to edit blog/code/BlogHolder.php like this:

If you currently have a blog installed, the widget fields are going to double up on those pages (as the blog extends the Page class). One way to fix this is to comment out line 30 in BlogHolder.php and remove the DB entry by running a /db/build.

 <?php
 
class BlogHolder extends Page {
	
      ........
	static $has_one = array(
	//	"SideBar" => "WidgetArea", COMMENT OUT
		'Newsletter' => 'NewsletterType'
      .......
	function getCMSFields() {
		$fields = parent::getCMSFields();
		$fields->removeFieldFromTab("Root.Content.Main","Content");
	//	$fields->addFieldToTab("Root.Content.Widgets", new WidgetAreaEditor("SideBar")); COMMENT OUT
 
	........

(taken from here: SSWidgetsDoku )

Cheers!

Avatar
raamklaza

Community Member, 182 Posts

11 November 2008 at 11:47am

Thnx maybe i should have read better :$