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

Newbie question on sidebars


Go to End


613 Views

Avatar
AstroDaz

Community Member, 3 Posts

30 September 2012 at 4:30am

Hi all

SS: 3.0.2
MySQL: 5.5.24
PHP: 5.4.3
Apache: 2.4.2
Win 7 64-bit

I am slowly getting to grips with how SS is laid out and have managed to add a new page type with an additional field into the CMS.... OK so far.

Now, I would like to be able to choose a sidebar for a page, from a list of sidebars that have been created in the CMS.
My thoughts are:

Create a SideBarPage page type, hidden from the menu
Create a parent SideBarHolder page type, allowing children of SideBarPage, hidden from the menu
Create an additional field in the CMS with a drop-down list of any SideBarPage that exist
Have the layout automatically include the content from the chosen sidebar

The first two bits I can do! Well, I can create a drop-down list OK, but how can I link that to the SideBarHolder childen?
And then how do I use that in the layout?

Any pointers gratefully received :)

Cheers
Daz