wedevelopnl / silverstripe-gridfieldsitetreebuttons
Modifies GridFields & GridField detail forms to use standard page edit form (with versioning, history & settings). Simple alternative for versionedgridfield.
Requires
- silverstripe/framework: ^5.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.20
This package is auto-updated.
Last update: 2024-12-18 13:23:34 UTC
README
Modifies GridFields & GridField detail forms to use standard page edit form (with versioning, history & settings).
Requirements
- See
composer.json
requirements
Installation
composer require wedevelopnl/silverstripe-gridfieldsitetreebuttons
After installation, run a dev/build
with flush to complete the installation
Usage
In GridFieldConfig
, replace GridFieldAddNewButton('toolbar-header-right')
with GridFieldAddNewSiteTreeItemButton('toolbar-header-right')
and new GridFieldDetailForm()
with GridFieldEditSiteTreeItemButton()
Example
$gridFieldConfig = GridFieldConfig_RecordEditor::create(); $gridFieldConfig->removeComponentsByType(GridFieldAddNewButton::class); $gridFieldConfig->addComponent(new GridFieldAddNewSiteTreeItemButton('toolbar-header-right')); $gridFieldConfig->removeComponentsByType(GridFieldAddNewButton::class); $gridFieldConfig->addComponent(new GridFieldEditSiteTreeItemButton());
License
See License
Maintainers
Development and contribution
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
See read our contributing document for more information.
Development and contribution
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. See read our contributing document for more information.