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.

Template Questions

Same content on multiple pages?


Reply

6 Posts   652 Views

Avatar
Romeo

9 August 2011 at 11:38pm (Last edited: 9 August 2011 11:57pm), Community Member, 67 Posts

Just coming back to Silverstripe after a time away so I've probably forgotten how to do a bunch of things, and am hoping someone can jog my memory. I have a situation where I have some content which needs to be editable by a site administrator (information about a conference), and which must appear on a number of pages. I can see how I can have 2 CMS editable content areas on each page, but that's not really what I'm after - I want each page to have a single CMS editable content area, plus another content area which is editable in a single place elsewhere, but displayed on the other pages. What's the neatest way of going about this?

Avatar
MarcusDalgren

10 August 2011 at 1:03am Community Member, 288 Posts

Put it on the SiteConfig.

Avatar
Romeo

10 August 2011 at 1:18am Community Member, 67 Posts

Thanks for the suggestion. I'll look into SiteConfig. It's not something I'm familiar with - the site was developed in Silverstripe 2.3.2, before the advent of SiteConfig. I've done the upgrade to the latest version, though, so it should be available to me.

Avatar
MarcusDalgren

10 August 2011 at 1:28am Community Member, 288 Posts

It's a normal DataObject so just add fields to it with a decorator. It's accessible in the CMS by pressing the globe on the top of the SiteTree list.

Avatar
Romeo

10 August 2011 at 1:37am Community Member, 67 Posts

Having had a brief glance at it, it seems to be to do with one set of information which is relevant for the site as a whole, which wouldn't quite work for my situation. What I'm dealing with is information to do with conferences. Each conference has a number of related subpages, each of which has to display on one side the same content from the parent page .... er, I think I've just realised the obvious solution, simply by describing things here. I have a hidden conference page, with a CMS editable content area, and a number of child pages, each of which shows this parent content field as well as its own specific content field. That would work, wouldn't it? Blindingly obvious, really!

Avatar
MarcusDalgren

10 August 2011 at 1:41am Community Member, 288 Posts

Yes it would. I read your first question as being something that could potentially be global and used anywhere but for your situation putting it on the parent page seems like the best solution.