2017 © Pedro Peláez
 

silverstripe-module silverstripe-pagesections

Adds configurable page sections and elements to your SilverStripe project.

image

flxlabs/silverstripe-pagesections

Adds configurable page sections and elements to your SilverStripe project.

  • Thursday, July 19, 2018
  • by FelixEggmann
  • Repository
  • 1 Watchers
  • 1 Stars
  • 104 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 14 Versions
  • 65 % Grown

The README.md

Silverstripe Pagesections

Elemental alternative for configurable page sections and elements., (*1)

Introduction

This module provides page sections for SilverStripe 4.x projects. Page sections are areas on a page where CMS users can add their own content in a structured way. Pages can have none, one or more page sections attached to them. Each page section is made up of various page elements, which themselves can or cannot have other page elements as children., (*2)

Installation

composer require flxlabs/silverstripe-pagesections

Add the extension to the DataObject that should contain a PageSection:, (*3)

Page:
  extensions:
    - PageSectionsExtension

By default the DataObject will have a PageSection called Main. To add additional sections, or change the name of the default section, specify them in the page_sections key., (*4)

Page:
  extensions:
    - PageSectionsExtension
  page_sections:
    - Main
    - Aside

Make sure to run dev/build and flush., (*5)

Usage

Defining an element:, (*6)

<?php
class TextElement extends FLXLabs\PageSections\PageElement
{
  public static $singular_name = 'Text';
  public static $plural_name = 'Texts';

  private static $db = [
    'Content' => 'HTMLText',
  ];

  // Page elements can have other page elements as children.
  // Use this method to restrict allowed childre.
  public function getAllowedPageElements()
  {
    return [
      // YourElement::class
    ];
  }

  // This will be used to preview the content in the CMS editor
  public function getGridFieldPreview()
  {
      return $this->dbObject('Content')->Summary();
  }
}

To render an element, create a Template. To render a page section use the RenderPageElements method exposed by the PageSectionsExtension:, (*7)

<div>
  $RenderPageSection('SectionName')
</div>

The Versions

19/07 2018

dev-feature/ss4-treeview

dev-feature/ss4-treeview http://github.com/flxlabs/silverstripe-pagesections

Adds configurable page sections and elements to your SilverStripe project.

  Sources   Download

MIT

The Requires

 

by Marco Crespi

silverstripe elements sections page sections page elements

10/07 2018

dev-feature/ss4-support

dev-feature/ss4-support http://github.com/flxlabs/silverstripe-pagesections

Adds configurable page sections and elements to your SilverStripe project.

  Sources   Download

MIT

The Requires

 

by Marco Crespi

silverstripe elements sections page sections page elements

28/06 2018

dev-develop

dev-develop http://github.com/flxlabs/silverstripe-pagesections

Adds configurable page sections and elements to your SilverStripe project.

  Sources   Download

MIT

The Requires

 

by Marco Crespi

silverstripe elements sections page sections page elements

28/06 2018

dev-master

9999999-dev http://github.com/flxlabs/silverstripe-pagesections

Adds configurable page sections and elements to your SilverStripe project.

  Sources   Download

MIT

The Requires

 

by Marco Crespi

silverstripe elements sections page sections page elements

28/06 2018

0.2.0

0.2.0.0 http://github.com/flxlabs/silverstripe-pagesections

Adds configurable page sections and elements to your SilverStripe project.

  Sources   Download

MIT

The Requires

 

by Marco Crespi

silverstripe elements sections page sections page elements

05/03 2018

0.1.6

0.1.6.0 http://github.com/flxlabs/silverstripe-pagesections

Adds configurable page sections and elements to your SilverStripe project.

  Sources   Download

MIT

The Requires

 

by Marco Crespi

silverstripe elements sections page sections page elements

05/03 2018

dev-feature/ui

dev-feature/ui http://github.com/flxlabs/silverstripe-pagesections

Adds configurable page sections and elements to your SilverStripe project.

  Sources   Download

MIT

The Requires

 

by Marco Crespi

silverstripe elements sections page sections page elements

22/02 2018

0.1.5

0.1.5.0 http://github.com/flxlabs/silverstripe-pagesections

Adds configurable page sections and elements to your SilverStripe project.

  Sources   Download

MIT

The Requires

 

by Marco Crespi

silverstripe elements sections page sections page elements

22/02 2018

dev-release/0.1.5

dev-release/0.1.5 http://github.com/flxlabs/silverstripe-pagesections

Adds configurable page sections and elements to your SilverStripe project.

  Sources   Download

MIT

The Requires

 

by Marco Crespi

silverstripe elements sections page sections page elements

30/01 2018

0.1.4

0.1.4.0 http://github.com/flxlabs/silverstripe-pagesections

Adds configurable page sections and elements to your SilverStripe project.

  Sources   Download

MIT

The Requires

 

by Marco Crespi

silverstripe elements sections page sections page elements

30/01 2018

dev-release/0.1.4

dev-release/0.1.4 http://github.com/flxlabs/silverstripe-pagesections

Adds configurable page sections and elements to your SilverStripe project.

  Sources   Download

MIT

The Requires

 

by Marco Crespi

silverstripe elements sections page sections page elements

23/01 2018

0.1.2

0.1.2.0 http://github.com/flxlabs/silverstripe-pagesections

Adds configurable page sections and elements to your SilverStripe project.

  Sources   Download

MIT

The Requires

 

by Marco Crespi

silverstripe elements sections page sections page elements

04/12 2017

0.1.1

0.1.1.0 http://github.com/flxlabs/silverstripe-pagesections

Adds configurable page sections and elements to your SilverStripe project.

  Sources   Download

MIT

The Requires

 

by Marco Crespi

silverstripe elements sections page sections page elements

21/09 2017

0.1.0

0.1.0.0 http://github.com/flxlabs/silverstripe-pagesections

Adds configurable page sections and elements to your SilverStripe project.

  Sources   Download

MIT

The Requires

 

by Marco Crespi

silverstripe elements sections page sections page elements