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.

Widgets /

Discuss SilverStripe Widgets.

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

Add an WidgetArea to the Database to store the widget details.

Go to End

4 Posts   2420 Views


Community Member, 10 Posts

14 July 2009 at 7:51am

Add an WidgetArea to the Database to store the widget details.
- Can someone please explain for me how i do that?


Community Member, 57 Posts

4 August 2009 at 8:24pm

$has_one = array('MyWidget' => 'WidgetArea');

Explain what you need more clearly!


Community Member, 5 Posts

11 October 2009 at 7:16pm

I am the first to admit I don't know much what I'm doing here, just trying to feel my way through and learn something if I can.

I think this might be my question also. Let me put it more clearly.

I am trying to follow the directions in the SS Widget documentation to add a widget area to my non-blog pages. There is a part ("Add Widgets to Other Pages") where it says to add some code to mysite/code/Page.php. I have copied/pasted this into my file, but when I go to run dev/build I get an error that says:

"Fatal error: Cannot redeclare class Page in (...)/mysite/code/Page.php on line 24"

I know I used to have this working in a previous incarnation of my website but whatever I did to ruin it, I am not sure. I am sure it was me though. :)

If anybody could offer some advice, I would sure appreciate it. There are a lot of really knowledgeable people around here, I know because if it weren't for the forums I'd've given up a long time ago. :)


Community Member, 5 Posts

18 October 2009 at 4:16pm

Does anybody know how to fix this? Any help would be greatly appreciated!