Login | Forgot password | Register
What is OpenID?
OpenID is an Internet-wide identity system that allows you to sign in to many websites with a single account.
With OpenID, your ID becomes a URL (e.g. http://username.myopenid.com/). You can get a free OpenID for example from myopenid.com.
For more information visit the official OpenID site.
Archive
SilverStripe Forums » Archive » Multiple Widget Areas
Our old forums are still available as a read-only archive.
|
Page:
1
|
Go to End | |
| Author | Topic: Multiple Widget Areas | 1849 Views |
-
Multiple Widget Areas

17 October 2007 at 3:06am Last edited: 17 October 2007 3:07am
Dear All,
We are using a three column layout and would like to set-up two widget areas - one for the left column, and one for the right.
Everything works well with one widget area but as soon as I add a second widget area to the page it stops working in the admin area. It looks like the problem is that the Javascript uses an ID to locate the widget area and if you have two areas it breaks.
Does anyone know if its possible to have two widget areas on the same page?
Thanks in advance.
Mark
-
Re: Multiple Widget Areas

18 April 2008 at 1:30pm
Same Issue, could we make two class Widget aera 1 and 2 ?
-
Re: Multiple Widget Areas

18 April 2008 at 5:38pm
Im pretty sure 2 widget areas will work. Following the example on the widgets page in the docs you would have 2 widgetareas defined (eg LeftSideWidgets, RightSideWidgets) instead of 1.
-
Re: Multiple Widget Areas

19 April 2008 at 12:46am
Hi,
I tryed yesterday many way to use two widget aera on a left sidebar
and a right sidebar. I tried 3 approach . And at each time the admin section was not working properly.
I was not able to drag Widget from the WidgetAeraEditor_availableWidget form the right side bar./*---------------------------------------------*/
/*----------- 1st approach -------------*/Just to create in a page.php a second widget
class Page extends SiteTree {
static $db = array(
);
static $has_one = array(
"leftSidebar" => "WidgetArea",
"RightSidebar" => "WidgetArea"
);function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.SideBar", new WidgetAreaEditor("leftSidebar"));
$fields->addFieldToTab("Root.Content.SideBar", new WidgetAreaEditor("RightSidebar"));
return $fields;
}}
/*-------- Result -----------*/
-> i ran db/build?flush=1
-> /admin and I am able to manage only the section of left
and it appear (after saving and refresh) the same widget value in both WidgetAreaEditor_usedWidgets and delete work only in the left (first) one/*---------------------------------------------*/
/*----------- 2nd approach -------------*/Just to create in a page.php a second widget but manage in a second tab
class Page extends SiteTree {
static $db = array(
);
static $has_one = array(
"leftSidebar" => "WidgetArea",
"RightSidebar" => "WidgetArea"
);function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.LeftSideBar", new WidgetAreaEditor("leftSidebar"));
$fields->addFieldToTab("Root.Content.RightSideBar", new WidgetAreaEditor("RightSidebar"));
return $fields;
}}
/*-------- Result -----------*/
-> i ran db/build?flush=1
-> admin and I am able to manage only the section of LeftSideBar and nothing move in WidgetAreaEditor_availableWidgets in the RightSideBar tab/*---------------------------------------------*/
/*----------- 3rd approach -------------*/stupid approach crate a new class RightWidgetArea in C:\....\lighttpd\htdocs\sapphire\widgets
<?php
class RightWidgetArea extends DataObject {
static $db = array();
static $has_many = array(
"Widgets" => "Widget"
);
function forTemplate() {
return $this->renderWith("WidgetArea");
}
}?>
and then
class Page extends SiteTree {
static $db = array(
);
static $has_one = array(
"leftSidebar" => "WidgetArea",
"RightSidebar" => "RightWidgetArea "
);function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.LeftSideBar", new WidgetAreaEditor("leftSidebar"));
$fields->addFieldToTab("Root.Content.RightSideBar", new WidgetAreaEditor("RightSidebar"));
return $fields;
}}
/*-------- Result -----------*/
(same has the 2nd approach)-> i ran db/build?flush=1
-> admin and I am able to manage only the section of LeftSideBar and nothing move in WidgetAreaEditor_availableWidgets in the RightSideBar tab/*--- Please help me ---*/
I will finish by hardcode and rendering manualy the widget of the right side bar..
But i am sure some one already succes to manage 2 section of widget on one page, doesn't you ?
So any idea is more than welcome
have a good one
MIke10 types of people , developers and .. others
-
Re: Multiple Widget Areas

19 April 2008 at 7:52am Last edited: 19 April 2008 7:52am
Ok, i know my previous msg was a little too long but to resume , no you can not administer 2 widget aera for the moment.. or for me something is missing..
Do you have any idea how to do this ?
| 1849 Views | ||
|
Page:
1
|
Go to Top |
Currently Online: Euphemismus, fearofbuttons
Welcome to our latest member: fearofbuttons



