jinjie/ss4-duplicate-dataobject

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

Installs: 19 446

Dependents: 1

Suggesters: 0

Security: 0

Stars: 3

Watchers: 2

Forks: 7

Open Issues: 1

Type:silverstripe-vendormodule

v2.0.0 2024-07-29 15:34 UTC

This package is auto-updated.

Last update: 2024-10-29 16:11:38 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

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