21295 Posts in 5734 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1398 Views |
-
Add a Widget not in blog module

23 August 2010 at 10:25pm Last edited: 24 August 2010 9:36pm
Hallo!
I am would like to add a widget area in an other page as the blog.
Conditions:
Silverstripe 2.4
theme: higherground
No blog module usedMySite/Code/Page.php is:
class Page extends SiteTree {public static $db = array(
);public static $has_one = array(
);
// Integrate widgets area in backend...
static $has_one = array(
"SideBar" => "WidgetArea");
function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Widgets", new WidgetAreaEditor("SideBar"));
return $fields;
}
// End Integrate widgets area in backend...}
after a http://localhost:8888/dev/build and a http://localhost:8888/?flush=1
I get a blank pageCan any one help me???
-
Re: Add a Widget not in blog module

24 August 2010 at 9:30pm Last edited: 24 August 2010 9:36pm
public static $has_one = array(
);// Integrate widgets area in backend...
static $has_one = array(
"SideBar" => "WidgetArea");You only declare $has_one once per class. So that needs to be
public static $has_one = array(
"SideBar" => "WidgetArea"
); -
Re: Add a Widget not in blog module

13 October 2011 at 8:29pm
Hello Conejo, I want to use also widgets without blog-modul, but I cannot follow your example, you talk with Willr about it.
What is necessary and how to use it? It would be very nice, if you'll explain your method step by step.
Thanks Uwe
| 1398 Views | ||
|
Page:
1
|
Go to Top |


