Skip to content

dynamic/core-tools

Repository files navigation

core-tools

Build Status Scrutinizer Code Quality Code Coverage Build Status codecov

Dependency Status

core tools to build common page types

Requirements

  • SilverStripe ^4.0

Installation

composer require dynamic/core-tools 3.0.x-dev

Example usage

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,
);

Elemental

DNADesign\Elemental\ElementalEditor:
  extensions:
    - Dynamic\CoreTools\ORM\ElementalEditorExtension

Upgrading

Upgrading form 2.0.0-alpha2 or before be sure to run the SettingsToConfigTask to migrate data from SiteConfig to the new GlobalSiteSetting DataObject.

Documentation

See the docs/en folder.