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

Footer Page Customization

Go to End

2 Posts   1774 Views


Community Member, 1 Post

27 February 2010 at 5:50am

I have a client who already has silverstripe installed and functioning properly (2.3.1). However, the "Footer Content"" page is set up in a very specific, almost too easy to use, manner. There are sections for page name, address1, address2, google maps link, store hours, copyright, and google analytics.

I need to drop an image into the footer, but the way its currently setup wont allow for any html, or images to be placed there. What can I do to manipulate the footer to allow for images to be placed in? Any help is appreciated, thanks


Community Member, 131 Posts

1 March 2010 at 2:56am

Edited: 01/03/2010 2:56am

You have a few options, in all options you have to modify FooterContent.php, and in some cases also
The options:
1) Set the datatype of one of the datafields to HTMLText or HTMLVarchar(255) (fx address1 => Text, becomes address1 => Varchar(255) ), so you can add HTML to the address1-field. If you like you can also change the addressfield to HTMLEditorField or TextareaField (instead of TextField).
2) Add an Image datafield to the database:

class FooterContent extends Page{
static $has_one = array (
myimage => image

And now: read up on ImageField, or SimpleImageField. You might also want to read up on images, image uploading and formfieldtypes for more advanced AND general information.
3) Create a new databasefield of the type HTMLText or HTMLVarchar(255). Create a new TextareaField FieldType to be able add any HTMLblock to your footer.

If you created new datafields&formfields (as in 2 and 3), of course you also have to modify your template-file (.ss), otherwise the new info wouldn't show up.

Good luck

BTW maybe the person who set up your database already set some of those fields to HTMLText or HTMLVarchar. Just try it out...