Hi,
I have problem.
Generally I want in one place add pictures to the sliders and they are to be displayed on all pages.
In SS 2.4.7 I add to SiteConfig
In SS3 I would do the same so:
I try add to DataExtension DataObject
AllSite.php
class AllSite extends DataExtension {
static $has_many = array (
'Sliders' => 'Slider'
);
public function updateCMSFields(FieldList $fields) {
//SLIDER
$gridFieldConfigSlider = GridFieldConfig::create()->addComponents(
new GridFieldToolbarHeader(''),
new GridFieldAddNewButton('toolbar-header-right'),
new GridFieldDataColumns(),
new GridFieldEditButton(),
new GridFieldDeleteAction(''),
new GridFieldDetailForm()
);
$gridFieldSlider = new GridField('Sliders', 'Slider', new DataList('Slider'), $gridFieldConfigSlider);
$fields->addFieldToTab('Root.Slider', $gridFieldSlider);
}
}
class Slider extends DataObject
{
static $db = array (
);
static $has_one = array (
'Slider' => 'Image',
);
function getCMSFields() {
return new FieldSet(
new UploadField('Slider')
);
}
}
in template i add:
<% loop SiteConfig %>
$Slider
<% end_loop %>
inn backend i can add image to slider but in frontend in right place picture not show
Who have any idea?
Sorry for my bad English