Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Adding a "Footer" tab on the top level

Go to End

12 Posts   5412 Views

Carbon Crayon

Community Member, 598 Posts

24 January 2009 at 12:04pm

your welcome :)


Community Member, 14 Posts

25 January 2009 at 12:12am

hi ,
First of all , Thanxs aram , Ur tuts helped a lot....

I m new to silver stripe.........
i got a problem with my footer.... i wanted a static footer that means it should be editable at admin end and same for all pages. Once i change the content it shld get updated for all pages.
I made a page type called footer.php like you said . Here is my code...


class Footer extends Page {

static $db = array(
'FooterLink' => 'HTMLText',

static $has_many = array(


function getCMSFields() {
$fields = parent::getCMSFields();

$fields->addFieldToTab('Root.Content.Main', new HtmlEditorField('FooterLink'), 'FooterLink');

return $fields;


class Footer_Controller extends Page_Controller{



and i put $FooterLink in page template " " where i hav made my footer div. Now i placed the function which calls my "Footer.PHP" in Page type " Page.PHP ". Here is the code....

class Page_Controller extends ContentController {

public function GetFooter(){
return DataObject::get_one("Footer");

my sidebar is working g8.....but I cant work out how to get the footer ....
tell me , WHts wrong with my code ??

Carbon Crayon

Community Member, 598 Posts

25 January 2009 at 2:05am

Hi Tomae, welcome to Silverstripe :)

I think the problem is the way you are calling footer in your template. When you return a DataObject like a Page as you do in your GetFooter() function you can call it in two ways. first would be like this:

<% control GetFooter %>
<% end_control %>

The second would be like this:


At the moment you are just calling $FooterLink so SS will be looking in the current Page class for the field FooterLink, but you want to tell SS that it needs to look in the DataObject that is returned by the function GetFooter().


Community Member, 14 Posts

27 January 2009 at 6:47pm works......... thanx man.......

Go to Top