micschk/silverstripe-gridfieldsitetreebuttons

There is no license information available for the latest version (2.0) of this package.

Modifies GridFields & GridField detail forms to use standard page edit form (with versioning, history & settings). Simple alternative for versionedgridfield.

Installs: 17 618

Dependents: 1

Suggesters: 1

Security: 0

Stars: 4

Watchers: 3

Forks: 3

Open Issues: 0

Type:silverstripe-vendormodule

2.0 2019-12-09 12:52 UTC

This package is auto-updated.

Last update: 2024-10-09 22:49:53 UTC


README

Modifies GridFields & GridField detail forms to use standard page edit form (with versioning, history & settings).

Best used in combination with:

Or use/subclass the preconfigured GridfieldPages module, which contains both the excludechildren module and this sitetreebuttons module:

Screenshot

Manage (add & edit) SiteTree items from a GridField:

Usage

In GridFieldConfig, replace GridFieldAddNewButton('toolbar-header-right') with GridFieldAddNewSiteTreeItemButton('toolbar-header-right') and new GridFieldDetailForm() with GridFieldEditSiteTreeItemButton()

Like this:

$gfconf = GridFieldConfig_RecordEditor::create();
$gfconf->removeComponentsByType('GridFieldAddNewButton');
$gfconf->addComponent(new GridFieldAddNewSiteTreeItemButton('toolbar-header-right'));
$gfconf->removeComponentsByType('GridFieldAddNewButton');
$gfconf->addComponent(new GridFieldEditSiteTreeItemButton());

Requirements

SilverStripe 3.0 or higher

Pro tip

Use/subclass the prefabricated GridfieldPages module as a all-in-one base: