17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1427 Views |
-
Blog and modules in home page?

22 February 2008 at 5:41pm
Hi, i wish see the widgets (links, countdown, etc) in the home page but only can see after press the blog link.
?¿
help me please
thanks
-
Re: Blog and modules in home page?

24 February 2008 at 5:16pm
You can have widgets on any page type by adding a WidgetArea to it. Open the page type code and add
static $has_one = array(
"MyWidgets" => "WidgetArea"
);then in the getCMSFields you will need to add the widget drag and drop system
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Widgets", new WidgetAreaEditor("MyWidgets"));
return $fields;
}Then last but not least you need to open up your template file and add the code to render the widget area. In this example you would need to put $MyWidgets in the template some where.
Remember to db/build and then flush the page.
-
Re: Blog and modules in home page?

27 February 2008 at 6:25pm Last edited: 27 February 2008 6:28pm
Ok, but where is "page type"??
explain me please
thanks
-
Re: Blog and modules in home page?

28 February 2008 at 10:36am
Rather then explain and give you the full solution its probably better if you actually read tutorial 1 and 2 - http://doc.silverstripe.com/doku.php?id=tutorials and get to under stand the basics first, Tutorial 2 should cover what you need to know for this.
| 1427 Views | ||
|
Page:
1
|
Go to Top |


