syntro/silverstripe-elemental-baseitem
Composer 安装命令:
composer require syntro/silverstripe-elemental-baseitem
包简介
A basic item handling permissions for elemental blocks with children
关键字:
README 文档
README
This module adds a blank base item which you can use to add sub-items to elements and a gridfield config which mimics the parent ElementalArea feel for these Items, allowing an editor to handle these "blocks" like elements.
This module is best used when the goal is to create an element which acts as a holder for some content "blocks". These blocks might for example be cards, images in a gallery or slides in a carousel.
Requirements
- SilverStripe:
^6 - Silverstripe elemental:
^6
Installation
composer require syntro/silverstripe-elemental-baseitem
License
See License
Documentation
First, simply extend the base item:
use Syntro\SilverStripeElementalBaseitem\Model\BaseItem; class Teaser extends BaseItem { private static $displays_title_in_template = true; private static $db = [ // Whatever you need for the item to render ]; private static $has_one = [ 'Section' => TeaserCardsBlock::class, ]; }
By default, the baseItem has a Title and a ShowTitle field, similar to the
BaseElement in elemental. They will also use the title composite field from the
silverstripe-elemental module. This behaviour can be disabled by setting
displays_title_in_template to false in yaml config or directly in the class.
Then, add the relation to the desired element and configure the gridfield:
use DNADesign\Elemental\Models\BaseElement; use Syntro\SilverStripeElementalBaseitem\Forms\GridFieldConfig_ElementalChildren; class TeaserCardsBlock extends BaseElement { private static $has_many = [ 'Teasers' => Teaser::class ]; /** * @return FieldList */ public function getCMSFields() { $this->beforeUpdateCMSFields(function ($fields) { if ($this->ID) { /** @var GridField $griditems */ $griditems = $fields->fieldByName('Root.Teasers.Teasers'); $griditems->setConfig(GridFieldConfig_ElementalChildren::create()); } }); return parent::getCMSFields(); } }
Maintainers
- Matthias Leutenegger hello@syntro.ch
Bugtracker
Bugs are tracked in the issues section of this repository. Before submitting an issue please read over existing issues to ensure yours is unique.
If the issue does look like a new bug:
- Create a new issue
- Describe the steps required to reproduce your issue, and the expected outcome. Unit tests, screenshots and screencasts can help here.
- Describe your environment as detailed as possible: SilverStripe version, Browser, PHP version, Operating System, any installed SilverStripe modules.
Please report security issues to the module maintainers directly. Please don't file security issues in the bugtracker.
Development and contribution
If you would like to make contributions to the module please ensure you raise a pull request and discuss with the module maintainers.
syntro/silverstripe-elemental-baseitem 适用场景与选型建议
syntro/silverstripe-elemental-baseitem 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6.82k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2021 年 04 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cms」 「silverstripe」 「elemental」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 syntro/silverstripe-elemental-baseitem 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 syntro/silverstripe-elemental-baseitem 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 syntro/silverstripe-elemental-baseitem 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A block that displays featured content - large image, title, description and link.
A multi file block for SilverStripe Elemental
Flexslider slideshow content block for Silverstripe Elemental
A block to display a list of links to child pages, or pages in current level
Element displaying information in regards to answers given to questions
GraphQL authentication for your headless Craft CMS applications.
统计信息
- 总下载量: 6.82k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 7
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2021-04-01