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.

Archive /

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

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

Documentation about Widgets: incomplete


Reply


4 Posts   1019 Views

Avatar
Blynx

Community Member, 20 Posts

17 April 2008 at 2:08pm

Edited: 17/04/2008 2:08pm

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?

Avatar
Willr

Forum Moderator, 5513 Posts

17 April 2008 at 3:04pm

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?)

Avatar
Willr

Forum Moderator, 5513 Posts

17 April 2008 at 3:31pm

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

Avatar
Blynx

Community Member, 20 Posts

17 April 2008 at 4:24pm

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.