jinjie / ss4-duplicate-dataobject
Adds a duplicate button to GridField in the CMS that enables duplicating of dataobjects
Installs: 19 807
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 7
Open Issues: 1
Type:silverstripe-vendormodule
Requires
This package is auto-updated.
Last update: 2024-11-29 16:22:09 UTC
README
Adds a duplicate button to GridField in the CMS that enables duplicating of dataobjects
Installation
composer require jinjie/ss4-duplicate-dataobject
Usage Example
This module uses the built in DataObject duplication.
See
- https://api.silverstripe.org/4/SilverStripe/ORM/DataObject.html#method_duplicate
- https://docs.silverstripe.org/en/4/developer_guides/model/relations/#cascading-duplications
// Add component on existing GridField $fields->fieldByName('Root.Main.MyGridField') ->getConfig() ->addComponent(new GridFieldDuplicateAction()); // Add component on new GridField $fields->push( GridField::create( 'MyGridField', 'MyGridField' )->addComponent(new GridFieldDuplicateAction()) );
Author
Developed by Jin Jie @ Swift DevLabs