2017 © Pedro Peláez
 

silverstripe-module silverstripe-flexible-content

Pages based on data objects for better content structure

image

nblum/silverstripe-flexible-content

Pages based on data objects for better content structure

  • Thursday, March 22, 2018
  • by nblum
  • Repository
  • 2 Watchers
  • 2 Stars
  • 28 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

silverstripe-flexible-content

Content pages based on data objects for better content structure, (*1)

screenshot, (*2)

Features

  • Supports draft/publish state
  • Drag n drop reordering
  • Copy & Paste
  • Black/white listing of block types

Disregards

  • Same content element on different pages

Difference to SilverStripe Blocks

Silverstripe Blocks has more features like block sets, forms ,... But the ui of Flexible-Content is more simple and easier to understand and use for non technical users., (*3)

Installation

composer require nblum/silverstripe-flexible-content

For a basic set of content element you may install the elements-package:, (*4)

composer require nblum/silverstripe-flexible-content-elements
  1. Create a page template ContentPage in your theme and add $FlexibleContent
  2. Run dev/build?flush=1
  3. Change the Page type to "Content Page" of every page you like

Configuration

Edit your config.yml file and add the following lines. This is the default config and only necessary if changes are neede, (*5)

FlexibleContent:
  availableContentElements:
    false
  forbiddenContentElements:
    - ContentElement

Custom Content Elements

Create a class which extends the ContentElement class or any other existing content element., (*6)

<?php

class MyTextContentElement extends \TextContentElement
{

    private static $db = array(
        'Splitview' => 'Boolean'
    );

    public function getCMSFields()
    {
        $fields = parent::getCMSFields();

        $field = new CheckboxField('MyCheckbox', 'a checkbox');
        $fields->addFieldToTab('Root.Main', $field);

        return $fields;
    }
}

And provide a include template file with the same name, (*7)

    <div <%if $Splitview %> class="splitview" <% end_if %>
        $Content
    </div>

For more examples have a look at the elements-package, (*8)

The Versions

22/03 2018

dev-migrate/v4-php5

dev-migrate/v4-php5

Pages based on data objects for better content structure

  Sources   Download

MIT

The Requires

 

content silverstripe

21/03 2018

dev-migrate/v4

dev-migrate/v4

Pages based on data objects for better content structure

  Sources   Download

MIT

The Requires

 

content silverstripe

10/09 2017

dev-master

9999999-dev

Pages based on data objects for better content structure

  Sources   Download

MIT

The Requires

 

content silverstripe

10/09 2017

0.2.0

0.2.0.0

Pages based on data objects for better content structure

  Sources   Download

MIT

The Requires

 

content silverstripe

20/10 2016

0.1.0

0.1.0.0

Pages based on data objects for better content structure

  Sources   Download

MIT

The Requires

 

content silverstripe

14/10 2016

dev-scrutinizer-patch-1

dev-scrutinizer-patch-1

Pages based on data objects for better content structure

  Sources   Download

MIT

The Requires

 

content silverstripe