2017 © Pedro Peláez
 

silverstripe-module silverstripe-gridstructuredcontent

Allows structuring SilverStripe CMS Content into CSS grid system layouts

image

burnbright/silverstripe-gridstructuredcontent

Allows structuring SilverStripe CMS Content into CSS grid system layouts

  • Wednesday, August 30, 2017
  • by jedateach
  • Repository
  • 3 Watchers
  • 12 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 2 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

SilverStripe Grid Structured Content Module

The layout-with-tables killer., (*1)

Why

Problem: structuring content beyond single columns., (*2)

Existing solutions:, (*3)

  • pre-define template(s) and additional db fields for holding content.
  • use tables within TinyMCE Content editor.
  • define content in seperate DataObjects, eg Page Elements Module
  • SilverStripe Blocks

New solution: use the CSS grids we've come to know and love, (*4)

This can be done by splitting up 'Content' field with a short delimiter string, and also storing a (sub)grid structure. The grid strucutre could be predefined by a designer, or edited by the user. This means defining the appropriate nesting of rows, columns, and width each column spans., (*5)

The same TinyMCE editor interface can be used, with the only difference being that you choose what part of the grid you are working on. On save, the seperate grid sections are concatenated into the 'Content' db field, and are delimited by a front-end invisible string., (*6)

When rendering on the front-end, the defined grid structure is traversed (depth first), dropping the delimited Content into the appropriate areas., (*7)

This idea relies on the fact that most grid systems are the same. Most have:, (*8)

  • Predefined number of columns
  • HTML structure & CSS classes for defining grid layout

For example, here is the bootstrap structure, (*9)

<div class="row">
    <div class="span4">...</div>
    <div class="span8">...</div>
</div>

Converted to a generic SilverStripe template:, (*10)

<div class="row">
    <% loop Columns %>
        <div class="span{$Width}">
            $Content
        </div>
    <% end_loop %>
</div>

The minor differences between grid systems should be handled by using a slightly different row template., (*11)

Benefits:

  • Grid system agnostic: it should would work with different CSS grid systems.
  • Un-obtrusive: it doesn't require any new data objects, or fields.
  • Clever: all content is stored in 'Content' db field, therefore taking full advantage of history, rollback etc.
  • Graceful: the 'Content' field could still be displayed in a single column format with $Content, because delimiters will be hidden. This also means content summaries can still be used.

Research

List of CSS Grid Systems/Frameworks

Javascript Grid Layout Editors

  • http://headwaythemes.com/features/headway-grid/
  • https://gridsetapp.com/features/
  • http://www.3x4grid.com/
  • http://gridster.net/

Similar ideas

  • http://wordpress.org/extend/plugins/advanced-wp-columns/

Screenshots

Editor, (*12)

Configuration, (*13)

The Versions

30/08 2017

dev-master

9999999-dev

Allows structuring SilverStripe CMS Content into CSS grid system layouts

  Sources   Download

BSD-2-Clause

The Requires