746 Posts in 310 Topics by 289 members
| Go to End | ||
| Author | Topic: | 5250 Views |
-
Re: General Widget Question

24 November 2009 at 2:23pm Last edited: 24 November 2009 2:24pm
Hi Will,
I have tried following the instructions from the doku page:
http://doc.silverstripe.org/doku.php?id=widgets#adding_widgets_to_other_pages
This ends up duplicating the Available Widgets section on the Widgets tab in the CMS.
The original Page.php had the following:
class Page extends SiteTree {
public static $db = array(
);
public static $has_one = array(
);
}Applying the instructions, the above now looks like this:
class Page extends SiteTree {
public static $db = array(
);
public static $has_one = array(
"Sidebar" => "WidgetArea",
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Widgets", new WidgetAreaEditor("Sidebar"));
return $fields;
}}
What am I doing wrong?
Can you please advise.
Thanks
Mauricio
-
Re: General Widget Question

17 June 2010 at 3:07am
Hello Ulysses/Mauricio,
What was your solution for this widget problem?
Thank you!
Marnix
-
Re: General Widget Question

18 June 2010 at 10:50pm
Never got a response from anyone on this. I gave up!!
Mauricio
-
Re: General Widget Question

7 November 2010 at 10:34am Last edited: 7 November 2010 10:36am
I think you may simply have a comma here:
public static $has_one = array(
"Sidebar" => "WidgetArea",
);
when you shouldn't. It's a bit funny it's in the documentation like that but looking at my code, the last item in the array has no comma at the end.
| 5250 Views | ||
| Go to Top |



