core tools to build common page types
- SilverStripe ^4.0
composer require dynamic/core-tools 3.0.x-dev
In your project's Page.php
:
private static $has_many = array(
'Sections' => PageSection::class,
);
private static $many_many = array(
'Promos' => Promo::class,
'Videos' => YouTubeVideo::class,
);
private static $many_many_extraFields = array(
'Promos' => array(
'SortOrder' => 'Int',
),
'Videos' => array(
'SortOrder' => 'Int',
),
);
To use Tags
, add the Tags
relation to the dataobjects and pages desired:
private static $many_many = array(
'Tags' => CoreTag::class,
);
DNADesign\Elemental\ElementalEditor:
extensions:
- Dynamic\CoreTools\ORM\ElementalEditorExtension
Upgrading form 2.0.0-alpha2 or before be sure to run the SettingsToConfigTask
to migrate data from SiteConfig to the new GlobalSiteSetting
DataObject.
See the docs/en folder.