Add an WidgetArea to the Database to store the widget details.
- Can someone please explain for me how i do that?
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
$has_one = array('MyWidget' => 'WidgetArea');
Explain what you need more clearly!
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. :)
Does anybody know how to fix this? Any help would be greatly appreciated!