roseblade/ss-duplicate-dataobject

This package is abandoned and no longer maintained. The author suggests using the jinjie/ss4-duplicate-dataobject package instead.

Adds a duplicate button to GridField in the CMS that enables duplicating of dataobjects. Code originally by Kong Jin Jie and upgraded for SS 5.2.

Installs: 21

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 7

Type:silverstripe-vendormodule

1.0.1 2024-06-10 10:21 UTC

This package is auto-updated.

Last update: 2024-11-13 13:36:11 UTC


README

Adds a duplicate button to GridField in the CMS that enables duplicating of dataobjects.

Forked from jinjie/duplicate-dataobject and updated to support SS5.

Installation

composer require roseblade/ss-duplicate-dataobject

Usage Example

This module uses the built in DataObject duplication.

See

// 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