746 Posts in 310 Topics by 289 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 542 Views |
-
Multiple Widget Areas. What problem?

19 March 2012 at 12:56pm
I have seen many people ask if you can have more than one widget area and many more reply that you can't.
I just tried it and you can.. its as easy as this in page.php...
static $has_one = array(
"Sidebar1" => "WidgetArea",
"Sidebar2" => "WidgetArea",
"Sidebar3" => "WidgetArea"
);function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Widgets", new WidgetAreaEditor("Sidebar1"));
$fields->addFieldToTab("Root.Content.Widgets", new WidgetAreaEditor("Sidebar2"));
$fields->addFieldToTab("Root.Content.Widgets", new WidgetAreaEditor("Sidebar3"));And then just splatter the $Sidebar1 $Sidebar2 $Sidebar3 wherever you want.
I just have to figure out how to make a pageholder page so I can start with one set of widgets for all pages.
-
Re: Multiple Widget Areas. What problem?

8 March 2013 at 4:12pm Last edited: 8 March 2013 4:16pm
Hello Tazzy
what version of silvestripe did you use on this?
i've try it on 2.4 but it doesnt work.
| 542 Views | ||
|
Page:
1
|
Go to Top |

