toastnz / quickblocks
银Stripe内容块模块
6.0.1
2022-08-05 04:04 UTC
- dev-master
- 2019.x-dev
- 6.0.1
- 6.0.0
- 5.0.9
- 5.0.8
- 5.0.7
- 5.0.6
- 5.0.5
- 5.0.4
- v5.0.3.x-dev
- 5.0.3
- 5.0.2
- 5.0.1
- 5.0.1b
- 5.0.0
- 4.4.8
- 4.4.7
- 4.4.6
- 4.4.5
- 4.4.4
- 4.4.3
- 4.4.2
- 4.4.1
- 4.4.0
- 4.3.8
- 4.3.7
- 4.3.6
- 4.3.5
- 4.3.4
- 4.3.3
- 4.3.2
- 4.3.1
- 4.3.0
- 4.2.0
- 4.1.2
- 4.1.1
- 4.1.0
- 4.0.0
- 3.6.3
- 3.6.2
- 3.6.1
- 3.6
- 3.0.x-dev
- 0.0.1
- dev-ss5
- dev-php8
- dev-hotfix/video-block-fix
- dev-feature/march-package-fix
- dev-feature/quicksilver
- dev-feature/namespace-update
- dev-quicksimple
- dev-block-updates
- dev-feature/blocks-upgrade
- dev-feature/block-updates
- dev-front-end-rewrite
This package is auto-updated.
Last update: 2024-09-13 03:29:30 UTC
README
简单的内容块系统。没有花哨的功能,易于实现。
要求
- 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
安装
将以下内容添加到您的 config.yml
Page: extensions: - Toast\QuickBlocks\QuickBlocksExtension
可选
PageController: extensions: - Toast\QuickBlocks\QuickBlocksControllerExtension
使用 Page
或其他扩展 SiteTree
的类。
在您的 Layout/Page.ss
模板中添加以下内容
<% loop $ContentBlocks %>
$ForTemplate
<% end_loop %>
配置
添加/删除可用的块类
Toast\QuickBlocks\QuickBlocksExtension: available_blocks: - Toast\QuickBlocks\TextBlock
创建自定义块
扩展 QuickBlock
创建新的块类型。
<?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
:
<%-- Your block template here --%>
<h2>$Title</h2>
$Content
待办事项
- 模板全局提供者
- 分区
- 重复处理程序
- 测试
- 使用
Through
表进行更高级的版本控制