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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Issues with static footer and editable content

Go to End

3 Posts   1404 Views


Community Member, 49 Posts

7 May 2011 at 5:58am

Edited: 07/05/2011 6:00am

Hi, I have been following an online tut over at ssbits on creating a Static Sidebar (in my case though it needs to be a footer) that can be edited in SS Admin CMS, basically it is to hold images, heres how i have gone about it (its also my first dive into dataobject_manager).

firstly created StaticFooter.php


class StaticFooter extends Page

static $has_many = array (
'Images' => 'ImageFooter'
public static $db = array(
public static $has_one = array(

public function getCMSFields()
$fields = parent::getCMSFields();
$managerfooter = new ImageDataObjectManager(
$this, // Controller
'Images', // Source name
'ImageFooter', // Source class
'Attachment', // Name on DataObject
'Title' => 'Title',
'Caption' => 'Caption'
return $fields;

static $allowed_children = array("none");


class StaticFooter_Controller extends Page_Controller {

now my class:


class ImageFooter extends DataObject
static $db = array (
'Title' => 'Text',
'Caption' => 'Text'

static $has_one = array (
'Attachment' => 'Image',
'StaticFooter' => 'StaticFooter'

public function getCMSFields_forPopup()
return new FieldSet(
new TextField('Title'),
new TextareaField('Caption'),
new FileIFrameField('Attachment')

<div class="clear"></div><!-- / clear -->

</div><!-- / content -->

<div id="footer">

<div style="margin:0px 0px 0px 35px; text-align:center;">

<% include StaticFooter %>

<div class="clear"></div>

</div><!-- / footer -->

</div><!-- / wrapper -->


and now finally

<% control GetStaticFooter %>
<% control Images%>
<div class="fimages" style="float:left; margin-left:10px;">
   <p style="color:#ffffff; font-size:0.7em"><strong>$Title</strong></p>
   $Attachment.SetRatioSize(133, 100)

<% end_control %>
<% end_control %>

Mostly all is working good, fields are there in Admin CMS etc, i can create the footer and add the images, no problem, however when im rendering the page to view im getting this error Parse error: syntax error, unexpected '}' in /home/wwwkevin/public_html/silverstripe-cache/ on line 246

try as i might i cant pin it down (now 6 hours and i've gone bald, aged rapidly and nearly done a packet of cigarettes,not foaming at the mouth yet so theres still hope.)

im thinking the fault is in or as when i dont include i dont get the error, is anybody out there with an experienced eye who wouldnt mind casting it over the code and point me in the right direction?


edit: am i supposed to be able to delete my own posts?... i just went to edit this post (in its former state, and hit delete by mistake. oops!


Community Member, 15 Posts

7 May 2011 at 11:30am

Try to change this
<% control Images%>


<% control Images %>

had that a while ago as well, can be annoying. hope thats the issue


Community Member, 49 Posts

7 May 2011 at 5:54pm

you my friend are an absolute hero, a silly noob error like that corrected as you kindly pointed out and now all is well, as for me well i have learnt a lesson on this one and that is not to edit files directly on my server using notepad, next time connecting notepad++ so i can have a little bit of syntax highling..

kind regards