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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Widgets /

Discuss SilverStripe Widgets.

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

Again "Bad widget class name given"

Go to End

2 Posts   2116 Views


Community Member, 2 Posts

18 December 2008 at 12:24pm

Edited: 18/12/2008 12:27pm

Hello everybody.

Must Say Like the new styling. But not here to comment on that.
I'm designing a site with SilverStripe. Been busy for ages but just learning SS and PHP.
It's a bit different from plain HTML. But almost finished my first site.

Solved all I encountered except the part of the Widgets. Can't seem to get it working.
And I have no clue anymore.

Followed the instructions and changed the /mysite/code/Page.PHP as below


class Page extends SiteTree {

public static $db = array(

public static $has_one = array(
"SideBar" => "WidgetArea",

function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Widgets", new WidgetAreaEditor("SideBar"));
return $fields;

Also changed in Themes/mytheme/template/includes/
The last lines to include the Widgets in the sidebar like this

<div class="clear"></div>
<div class="sidebarBottom">

Finally I like to mention that I changed the /templates/Layout/
to include the side bar at any given moment and not just when a menu is present. I did this by removing the "If" statement like this

<div class="typography">

<% include SideBar %>
<div id="Content">

<% if Level(2) %>
<% include BreadCrumbs %>
<% end_if %>


<% if Menu(2) %>
<% end_if %>


That is all I did and I included several widget's but in the CMS the installed Widgets all give the error of "Bad widget class name given". While the Blog Widgets do seem to Work.

I'm developing directly on the server so but with the Blog Widgets working I still have no clue what is not working. I am a Newbe so please let any comment given be at my level of understanding. But than again any reaction is welcome.


Community Member, 7 Posts

27 January 2009 at 7:22pm

   public static $has_one = array( 
   "SideBar" => "WidgetArea", 

I think the comma needs to be removed after "Widget Area".

For me the widgets still didn't work until I added the archive widget to the widget area first.