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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

Creating "Content Regions" Easy and fast from admin!


Go to End


3 Posts   2138 Views

Avatar
jorrie

Community Member, 40 Posts

29 March 2010 at 12:27pm


I am looking for some point of direction in creating "Content Regions". To clarify what I mean here an example:

Your hompage has many graphics and 4 columns in the middle filled with text named col1,col2,col3,col4
Now What I want is to have those 4 columns to show up in the Admin backend when editing the homepage where these 4 columns will be displayed.

Whats the right way to do this?
Its okay to have some code in my home.ss file but would be nice if this can also be made possible in the Admin backend for more flexibility. This is as such one of the least features I miss in silverstripe ( Using beta 2.4 version 2 )

Avatar
Kalileo

Community Member, 127 Posts

29 March 2010 at 3:47pm

Edited: 29/03/2010 3:48pm

Simply add a HomePage class with the extra fields for the columns, similarly to what is described in the documentation under "Extending a basic site" or so. Then make your template for your homepage, and there you can access the 4 columns with the field names as you defined them in your Homepage class.

Doing so you can edit the content of the 4 columns in the CMS, each one in its own field.

Avatar
Willr

Forum Moderator, 5523 Posts

29 March 2010 at 4:34pm

Also if you need flexible content regions (like you want to mix up the layouts) check out the unreleased promo spots module - http://open.silverstripe.org/browser/modules/promospots/trunk it allows you to define a selection of regional templates then swap out the content in those regions. Its also a ball of fun to play with!.