nobrainerweb/silverstripe-content-blocks 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nobrainerweb/silverstripe-content-blocks

最新稳定版本:2.3

Composer 安装命令:

composer require nobrainerweb/silverstripe-content-blocks

包简介

Split your page content into manageable blocks/sections of content, each with their own template

README 文档

README

Split your page content into manageable sections/blocks of content, each with their own template.

Create compelling and unique pages

This module gives you the option to create your content, in little blocks, instead of just one big content area.

When the module is installed, a "Blocks" tab will be added to all pages. The blocks tab holds a GridField, that allows you to create as many blocks of content as you would like. Each block of content can have it's own template assigned. The module commes with a set of standard templates.

You can easily create your own block templates and even your own block DataObjects with unique fields. This makes it very easy for content editors to create pages with lots of variation, without having to know HTML, fiddle around with tables and so on. Create your own block templates and/or extend the Block DataObject to create:

  • Image lists (simple gallery)
  • Employee listings
  • Product listings
  • and much more

Version compatibility

Tested on Silverstripe 3.1.2

Installation instructions

  • Put this module under the root folder of site, named content-blocks.
  • Add the following code to your themes/your_design/templates/Layout/Page.ss where you want the content blocks to be rendered:
<div class="blocks"><% loop ActiveBlocks %>$Me<% end_loop %></div>

Or you can ask for a single Block to render via it's ID (replace 5 with your ID):

$OneBlock(5)

Or use Composer:

"nobrainerweb/silverstripe-content-blocks": "dev-master"
  • run sitename.com/dev/build?flush=all

  • The module will copy content-blocks/templates/BlockTemplates to themes/your_design/templates/BlockTemplates, should this fail, please copy the files manually.

  • The module will copy content-blocks/css/sections.css to themes/your_design/block.css, should this fail, please copy the file manually.

Usage and customization:

  • add your own templates to themes/your_design/templates/BLcokTemplates, they need to have the extension .ss and delete any unwanted templates (there is full example set of fixed width and fluid width templates included in the module)
  • allways run dev/build?flush=1 after adding templates
  • remember to ?flush=1 after modification of templates

Screenshots

Overview Overview in page editing

modeladmin View all blocks across pages in a ModelAdmin

Detail views

TODO:

  • Option to add more content placeholders without coding - site config?
  • Handle search
  • Versioning

IDEAS

  • Save available templates in database (enum field) - create on dev/build or use template manifest
  • Build in template generator
  • Form blocks
  • Better previews (C/P from design)
  • Perhaps add foundation templates as a suggested composer requirement (and other CSS frameworks)

统计信息

  • 总下载量: 1.46k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 30
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 29
  • Watchers: 9
  • Forks: 16
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2014-01-25