Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Documentation about Widgets: incomplete

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: 994 Views
  • Blynx
    Avatar
    Community Member
    20 Posts

    Documentation about Widgets: incomplete Link to this post

    I just tried to allow Widgets on all pages by following the steps in the documentation:
    http://doc.silverstripe.com/doku.php?id=widgets#adding_widgets_to_other_pages
    However, this left me with a fatal error that stated that "a field called 'SideBar' appears twice in your form". This happens because I also have the blog module installed, which itself installs the field "sidebar" again.
    The solution is to uncomment the appropriate line (30 in the current version) in the "BlogHolder.php":
    $fields->addFieldToTab("Root.Content.Widgets", new WidgetAreaEditor("SideBar"));

    Could you please add this to the documentation?

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: Documentation about Widgets: incomplete Link to this post

    Hi,

    Anyone can edit and write to the documenation! You can sign up and click edit page and add your thoughts / changes!.

    But your fix to uncomment that line.. is it even commented out in the first place? On my version its not and and doubt it should be. '

    The proper fix maybe would be to rename that field in the documenation so we dont get a conflict (2 fields called SideBar which im guessing the error is?)

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: Documentation about Widgets: incomplete Link to this post

    Ive updated the wiki, I have tried to explain it but if you have a better way to explain it feel free to write it down

  • Blynx
    Avatar
    Community Member
    20 Posts

    Re: Documentation about Widgets: incomplete Link to this post

    Sorry, I meant that this line should be commented out, you're right.
    The fix with renaming the field does not produce an error when displaying the site, however it produces the "Available Widgets" area twice in the blog management in the CMS. Thus, the appropriate line has to be commented out one way or the other. To prevent braking the blog template I would recommend keeping the name "Sidebar" though.

    994 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.