Skip to content

dawb/silverstripe-sections

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Silverstripe sections

This module splits pages into reusable sections that can used across multiple pages.

Installation

Composer is the recommended way of installing SilverStripe modules.

composer require coreiho/silverstripe-sections 1.*

Customisation

Styles

For each section type, you can define additional styles in your config.yml.

LinkSection:
  styles:
    - Layout1
    - Layout2

This will provide optional classes for each section type to choose from in the CMS.

Templating

Below is the template hierarchy.

  1. SectionType_PageType_Style.ss e.g. LinkSection_HomePage_Tiles.ss
  2. SectionType_Style.ss e.g. LinkSection_Tiles.ss
  3. SectionType_PageType.ss e.g. BannerSection_HomePage.ss
  4. SectionType.ss e.g. GallerySection.ss

Limit or exclude sections

You can limit or completely exclude sections from a page type by defining it in your config.yml

HomePage:
  LimitSectionTypes:
    BannerSection: 0
    LinkSection: 0
    PeopleSection: 1

Limiting the total sections a page in your config.yml

HomePage:
  LimitSectionTotal: 3

About

The SilverStripe Sections Module

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 94.2%
  • Scheme 5.8%