Hi, hope someone can help with my problem. I'm relatively new to Silverstripe and am getting up to speed with the CMS framework. I've put together some project overview pages on a site, they show images, a brief description and a section that lists the key services used on a particular project, ie:
- Copywriting
- Photography
- Logo design
- Brochure design...etc
Rather than let the client type these services out on every project page I want to put a section on the CMS that lists 15-20 master items. When the client builds a new project page they select which services are relevant to a project with checkboxes, that way only the defined list items appear on the public pages as appropriate.
So far I've managed to configure a single checkbox sitewide on the CMS with the following (from this forum):
class Page extends SiteTree {
static $db = array(
'CheckboxValue' => 'Boolean'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Main", new CheckboxField ("CheckboxValue"));
return $fields;
}
}
with the following on my template:
<% if CheckboxValue %>
<p>SOLD</p>
<% end_if %>
But I'm struggling to see how I can add multiple checkboxes against a defined list on the CMS. Ideally an ordered list of the items on a separate tab in the CMS would keep things neat and simple for my client to administer.
Any help greatly appreciated!