nathancox/versionedgridrows
Composer 安装命令:
composer require nathancox/versionedgridrows
包简介
A SilverStripe extension to mark gridfield rows for versioned objects as draft or modified
README 文档
README
This module extends GridField to add some styles and labels for showing the published state of versioned objects.
Maintainer Contacts
Nathan Cox (me@nathan.net.nz)
Requirements
- SilverStripe 3.1+
Documentation
Installation Instructions
With composer:
composer require nathancox/versionedgridrows
Usage Overview
Configuration via config.yml:
VersionedGridRows: mode: 'component' # can be "component", "config" or "always" show_published: false # set to true to show a flag on published items as well
Options for the mode setting:
mode: 'component'
Only add row styles to GridFields with the VersionGridRows component added to them. This is done like any other component:
$gridFieldConfig->addComponent(new VersionedGridRows('Title'));
The constructor argument ("Title") specifies the name of the column the "draft" or "modified" flags will be appended to. Leave blank to not automatically append the flags.
mode: 'always'
Styles will be added to all GridFields that managed versioned objects. If you want to add flags you need to do it manually with something like this:
$summary_fields = array( 'VersionedTitle' => 'Title' ); ... public function VersionedTitle() { return VersionedGridRows::get_column_content($this, $this->Title); }
mode: 'config'
Specify a list of classes that styles will be added to.
VersionedGridRow: mode: 'config' classes: - Page - StaffMember - HomepageSlide
You will have to add version status flags manually as shown above.
Known Issues
统计信息
- 总下载量: 509
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2017-07-25
