nathancox / versionedgridrows
一个 SilverStripe 扩展,用于标记版本化对象的网格字段行状态为草稿或修改
v1.1.0
2017-07-25 04:54 UTC
Requires
- silverstripe/framework: ~3.4
This package is not auto-updated.
Last update: 2024-09-21 00:53:43 UTC
README
此模块扩展了 GridField,添加了一些样式和标签来显示版本化对象的发布状态。
维护者联系方式
Nathan Cox (me@nathan.net.nz)
要求
- SilverStripe 3.1+
文档
安装说明
使用 composer
composer require nathancox/versionedgridrows
使用概述
通过 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
模式设置选项
mode: 'component'
仅向添加了 VersionGridRows 组件的 GridField 添加行样式。这就像添加任何其他组件一样
$gridFieldConfig->addComponent(new VersionedGridRows('Title'));
构造函数参数("标题")指定了附加 "草稿" 或 "修改" 标志的列名称。留空以自动附加标志。
mode: 'always'
样式将被添加到所有管理版本化对象的 GridField 中。如果您想添加标志,需要手动添加,如下所示
$summary_fields = array( 'VersionedTitle' => 'Title' ); ... public function VersionedTitle() { return VersionedGridRows::get_column_content($this, $this->Title); }
mode: 'config'
指定一个样式将被添加到的类列表。
VersionedGridRow: mode: 'config' classes: - Page - StaffMember - HomepageSlide
您将需要手动添加版本状态标志,如上所示。