diff --git a/_config/config.yml b/_config/config.yml index 7b3db94..08e452d 100644 --- a/_config/config.yml +++ b/_config/config.yml @@ -1,3 +1,7 @@ --- name: silverstripe-elemental-links-config --- +# Publish file when uploaded for a Link +SilverStripe\LinkField\Models\FileLink: + owns: + - File \ No newline at end of file diff --git a/src/Model/LinkListObject.php b/src/Model/LinkListObject.php index dd6cce7..fdf948d 100644 --- a/src/Model/LinkListObject.php +++ b/src/Model/LinkListObject.php @@ -4,13 +4,15 @@ use SilverStripe\ORM\DataObject; use SilverStripe\Forms\FieldList; +use SilverStripe\Versioned\Versioned; +use SilverStripe\LinkField\Models\Link; use SilverStripe\LinkField\Form\LinkField; use Dynamic\Elements\Links\Elements\LinksElement; -use SilverStripe\LinkField\Models\Link; /** * Class \Dynamic\Elements\Links\Model\LinkListObject * + * @property int $Version * @property string $Title * @property string $Content * @property int $SortOrder @@ -18,6 +20,7 @@ * @property int $LinkID * @method LinksElement LinkList() * @method Link Link() + * @mixin Versioned */ class LinkListObject extends DataObject { @@ -52,6 +55,22 @@ class LinkListObject extends DataObject 'Link' => Link::class, ]; + /** + * @var array + * @config + */ + private static $owns = [ + 'Link', + ]; + + /** + * @var array + * @config + */ + private static $extensions = [ + Versioned::class, + ]; + /** * @var array * @config diff --git a/templates/Dynamic/Elements/Links/Elements/LinksElement.ss b/templates/Dynamic/Elements/Links/Elements/LinksElement.ss index 5260ec1..1d88ac4 100644 --- a/templates/Dynamic/Elements/Links/Elements/LinksElement.ss +++ b/templates/Dynamic/Elements/Links/Elements/LinksElement.ss @@ -6,24 +6,24 @@