2017 © Pedro Peláez
 

silverstripe-module quickblocks

Silverstripe content blocks module

image

toastnz/quickblocks

Silverstripe content blocks module

  • Sunday, July 29, 2018
  • by permanentinc
  • Repository
  • 4 Watchers
  • 0 Stars
  • 197 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 20 Versions
  • 177 % Grown

The README.md

SilverStripe QuickBlocks

Simple content blocks system. Nothing fancy, easy to implement., (*1)

Requirements

  • silverstripe/cms 4.0.x
  • silverstripe/framework 4.0.x
  • symbiote/silverstripe-gridfieldextensions 3.1.1
  • edgarindustries/youtubefield 1.1
  • sheadawson/silverstripe-linkable 2.0.x-dev

Installation

Add the following to your config.yml:, (*2)

Page:
  extensions:
    - Toast\QuickBlocks\QuickBlocksExtension

Optionally:, (*3)

PageController:
  extensions:
    - Toast\QuickBlocks\QuickBlocksControllerExtension

Use Page or other class that extends SiteTree., (*4)

In your Layout/Page.ss template, add the following:, (*5)

<% loop $ContentBlocks %>
    $ForTemplate
<% end_loop %>

Configuration

Add / remove available block classes

Toast\QuickBlocks\QuickBlocksExtension:
  available_blocks:
    - Toast\QuickBlocks\TextBlock

Create a custom block

Extend QuickBlock to create a new block type., (*6)

<?php

namespace Toast\QuickBlocks;

class MyBlock extends QuickBlock
{
    private static $singular_name = 'My Block';
    private static $plural_name = 'My Blocks';
    private static $icon = 'mysite/images/blocks/custom.png';

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

}

/themes/default/templates/Toast/QuickBlocks/MyBlock.ss:, (*7)

<%-- Your block template here --%>



$Title

$Content

Todo:

  • Template global providers
  • Zoning
  • Duplicate handlers
  • Tests
  • Through tables for more advanced versioning

The Versions

29/07 2018
21/02 2018

0.0.1

0.0.1.0

Silverstripe content blocks module

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe modular content blocks