xddesigners/page-content-block
Composer 安装命令:
composer require xddesigners/page-content-block
包简介
Adds a page content block to SilverStripe elemental editor
README 文档
README
Adds a page content block to the elemental editor.
What it is
A Page content block is used to display the content from the Page model in the elemental area. This is useful for instance on pages like BlogPost's, UserForms or any page type that is added by a module.
For who it exists
For example, users editing blog posts want a lighter editing experience, but keep the flexibility of a block editor. This module sits in between by re-inserting the content field and moving the Elemental area to a Layout tab.
What it does
It simply renders the current page controller in an Element.
So you can access the page $Content, $Title or any other method on that element.
The PageContentBlock is created on page creation so the element always exists.
The user can simply start typing in the content field and keeps the flexibility of adding any blocks around the PageContentBlock.
Templating
The block searches for a block template closest matching the current page type.
It looks fot it's own class ancestry and adds "ContentBlock" to the end of the class name.
For example, for a BlogPost it will search for a BlogPostContentBlock.ss, if not found it will go down the ancestry until it will fallback to the PageContentBlock.ss.
He will search in one folder namespaced to this module. The template folder path is templates/XD/PageContentBlock/Models/YourClassContentBlock.ss.
Configuration
The creation of the PageContentBlock is configurable, this module looks on the current page type for a config setting default_blocks.
You could also use that setting to create a default banner block on BlogPosts.
Page: default_blocks: - XD\PageContentBlock\Models\PageContentBlock BlogPost: default_blocks: - MyFeaturedImageBlockClass - XD\PageContentBlock\Models\PageContentBlock
If you don't want the re-inserting of the content field you can set the keep_content_field setting to false.
XD\PageContentBlock\Extensions\ElementalPageExtension: keep_content_field: false
If you want to disable the re-inserting of the content field on a specific class, for example the home page.
HomePage: hide_content_field: true
xddesigners/page-content-block 适用场景与选型建议
xddesigners/page-content-block 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 597 次下载、GitHub Stars 达 2, 最近一次更新时间为 2019 年 09 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「editor」 「silverstripe」 「blocks」 「elements」 「elemental」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 xddesigners/page-content-block 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 xddesigners/page-content-block 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 xddesigners/page-content-block 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Blocks for NetCommons Plugin
A block that displays featured content - large image, title, description and link.
Flexslider slideshow content block for Silverstripe Elemental
A block to display a list of links to child pages, or pages in current level
Collection of useful and reusable SilverStripe Elemental stylings properties
Silverstripe content blocks module
统计信息
- 总下载量: 597
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 16
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2019-09-19