Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Bad widget class name given

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

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

Page: 1
Go to End
Author Topic: 1982 Views
  • teejay
    Avatar
    Community Member
    63 Posts

    Bad widget class name given Link to this post

    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.

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: Bad widget class name given Link to this post

    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"));

  • teejay
    Avatar
    Community Member
    63 Posts

    Re: Bad widget class name given Link to this post

    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.

  • Macello
    Avatar
    Community Member
    37 Posts

    Re: Bad widget class name given Link to this post

    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!

  • iop
    Avatar
    Community Member
    6 Posts

    Re: Bad widget class name given Link to this post

    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' "?

    1982 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.