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

Bad widget class name given


Go to End


5 Posts   2651 Views

Avatar
teejay

Community Member, 63 Posts

19 August 2008 at 10:17am

Edited: 19/08/2008 10:18am

Hi,

I am trying get getting Widgets running but I am running in a couple of problems. I downloaded the children widget form the download section and copied the extracted folder in my root silverstripe folder. Then is rebuild the database. After that i added this to my NewsHolder.

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

After that I got a new tab in the admin page as expected. So far as good but when I want to add the children widget to my holder ist fires 2 http requests right after another.

1. http://mmm.nz/Widget_Controller/EditableSegment/ChildrensWidget
2 http://mmm.nz/Widget_Controller/EditableSegment/NoWidget

If i press on publish nothing will be displayed after a refresh. :( this is really disapointing :(

Best regards an I hope somebody can help me.

Avatar
Willr

Forum Moderator, 5523 Posts

19 August 2008 at 11:14am

You have called your database field 'SideBar' where as you use 'Sidebar' in your widget area field. They are case sensitive eg this new WidgetAreaEditor("Sidebar")); needs to be new WidgetAreaEditor("SideBar"));

Avatar
teejay

Community Member, 63 Posts

19 August 2008 at 2:59pm

Oh yes I am so dumm :( thx a lot. some times you don't see the forest cause of so mutch trees.

I have an other questions about the widgets. Is it possible to add a widget to a holderpage and the children inherits this widget ?? So that I just have to add a widget one time to affect all pages. Is this possible and how could i realize it.

Avatar
Macello

Community Member, 37 Posts

9 September 2008 at 11:01pm

Hello i have the same problem even if i made the said changes, rest look same like that, only if i try to save, it logs me out, comin back in and draggin the widget to the holder, it dissapears immediatly, can somebody give me an exact step by step installation guide for widgets? the one in the docs, is too difficult for me as not every step is explained and, as my language is german basiclly!

Avatar
iop

Community Member, 6 Posts

10 September 2008 at 12:59am

Edited: 10/09/2008 1:00am

Hello,

I posted already here http://www.silverstripe.com/website-authors-forum/flat/165915#post165915
but after posting I got firsts a "Bad widget class name given" error while draging the widget to the right into the "Widgets currently used" field and then, after "/?flush=1" it seemed to work. I could put in some content but again, I can see my widget only by adding simultaneous a "virtual page" to my site.

So what happens when I add a virtual page? Is there something being activated in a "virtualPageScript" or something why you can see this "virtual page 'widget' "?