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, biapar, Willr, Ingo, swaiba, simon_w

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


Reply

4 Posts   1883 Views

Avatar
pmg

14 July 2009 at 7:51am Community Member, 10 Posts

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

Avatar
joshy

4 August 2009 at 8:24pm Community Member, 57 Posts

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

Explain what you need more clearly!

Avatar
1

11 October 2009 at 7:16pm Community Member, 5 Posts

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. :)

Avatar
1

18 October 2009 at 4:16pm Community Member, 5 Posts

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