micschk / silverstripe-rightsidebar

允许在CMS中添加一个右侧边栏,用于存放当前编辑记录的选项/字段

安装次数: 18,315

依赖者: 2

建议者: 0

安全性: 0

星标: 11

关注者: 7

分支: 4

开放问题: 0

语言:CSS

类型:silverstripe-vendormodule

2.0 2018-07-09 08:27 UTC

This package is not auto-updated.

Last update: 2024-09-14 17:42:45 UTC


README

要求

  • SilverStripe CMS & Framework 4+

概述

允许在CMS中添加一个右侧边栏,用于存放当前编辑记录的选项/字段。从Silverstripe博客模块中抽象出来,也可用于其他页面(由ao. Michael Strong/Silverstripe开发的博客模块)

RightSidebar的行为类似于标签页(类似于它扩展的CompositeField)。

在class声明之前添加use

use Restruct\RightSidebar\RightSidebar;

用法(在getCMSfields中)

	$fields->addFieldsToTab('Root.Main', RightSidebar::create('Options'));
	$fields->addFieldsToTab('Root.Main.Options', array(
		$publishDate = DatetimeField::create("PublishDate", "Publish Date"),
		TextField::create('Author')
	));

	// Add to Main tab (fixed width) and render an outer template to deal with our custom layout
	$fields->addFieldsToTab('Root.Main', RightSidebar::create('Options'));
	$fields->fieldByName('Root')->setTemplate('Restruct\RightSidebar\Forms\RightSidebarInner');

	// OR: Add it full-screen (collapsible) and render an outer template to deal with our custom layout
	$fields->insertBefore(RightSidebar::create('Options'), 'Root');
	$fields->fieldByName('Root')->setTemplate('Restruct\RightSidebar\Forms\RightSidebar');