coreiho / silverstripe-sections
1.4.1
2016-10-27 01:03 UTC
Requires
README
此模块将页面拆分为可重复使用的部分,这些部分可以在多个页面中使用。
安装
Composer 是安装 SilverStripe 模块的首选方式。
composer require plato-creative/silverstripe-sections 1.*
自定义
样式
对于每种部分类型,你可以在 config.yml 中定义额外的样式。
LinkSection: styles: - Layout1 - Layout2
这将提供可选的类,供 CMS 中的每种部分类型选择。
模板化
以下是模板层次结构。
- SectionType_PageType_Style.ss 例如 LinkSection_HomePage_Tiles.ss
- SectionType_Style.ss 例如 LinkSection_Tiles.ss
- SectionType_PageType.ss 例如 BannerSection_HomePage.ss
- SectionType.ss 例如 GallerySection.ss
部分配置
限制或排除
您可以通过在 config.yml 中定义它来限制或完全排除页面类型中的部分。您还可以设置页面具有预设部分,并决定是否希望部分在页面间共享。
HomePage: section_options: BreadcrumbSection: limit: 0 # excluded from HomePage ContentSection: limit: 1 # Only 1 can ever be added
将预设部分添加到页面类型
您还可以设置页面具有预设部分,并决定是否希望部分在页面间共享。
FormPage: section_options: FormSection: presets: 'Home Page Form': 'shared' # section is shared across home pages 'Another Form': 'not-shared' # section is not shared across home pages