plasticstudio/modulemanager
Composer 安装命令:
composer require plasticstudio/modulemanager
包简介
Module Manager for SilverStripe - forked from jaedb/modulemanager
关键字:
README 文档
README
Description
Manage site-wide modules (aka widgets) and select the pages on which they are to appear. This allows you to repurpose content across your website, and build easily modular content elements.
Dependencies
- SilverStripe 4
For a Silverstripe CMS 4.x compatible version of this module, please see the 3.x or 4.x release line.
- Release 4.x uses new namespace (plasticstudio\ModuleManager)
- Release 3.x uses legacy namespace (Jaedb\ModuleManager)
For a Silverstripe CMS 3.x compatible version of this module, please see the 3 branch, or 2.x release line.
Installation
composer require plasticstudio/ModuleManager- Run /dev/build?flush=1
- Setup your Module Positions. There is an initial
after_contentarea setup to get you started. - Insert your Module Positions in your template (ie
$ModuleArea(after_content))
Usage
Create a module area
- Edit your
app/_config/config.ymlfile to add any additional module areas. Use the following format:
PlasticStudio\ModuleManager\ModuleManager:
positions:
{ALIAS}: "{NAME}"
- In your template, use the code
$ModulePosition(ALIAS)where ALIAS is your position's alias string. - Run dev/build (
/dev/build?flush=all)
Create a module instance
- Within the Module Manager admin, create a new
Moduleobject. The type dropdown will show the list of available module types. - Assign your new
Moduleobject to one of the positions you configured inconfig.yml.
Build a custom module type
- Create a new DataObject file
app/src/Modules/MyModule.php:
<?php
class MyModule extends Module {
// set module names
private static $singular_name = 'My Module';
private static $plural_name = 'My Modules';
private static $description = 'This is my great custom module';
// your custom fields
static $db = array(
'MyField' => 'Varchar(255)'
);
// create cms fields
public function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Main', TextField::create('MyField', 'My field'));
return $fields;
}
}
- Create your template file
app/templates/{NameSpace}}/MyModule.ss:
<div class="module module_my-module">
<h3>$Title</h3>
<div class="module-content">
$MyField
</div>
</div>
- Perform a build and flush (
/dev/build?flush=all) - Now you can create your custom module type
Modules inheritance
To avoid having to set a module on each page within a section, you can set your pages to inherit it's parent page's modules.
- Open your page, and navigate to the Modules tab
- Check Inherit Modules and Save your page.
- You can apply this inheritance further up the page hierarchy if required.
plasticstudio/modulemanager 适用场景与选型建议
plasticstudio/modulemanager 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.46k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 05 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「silverstripe」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 plasticstudio/modulemanager 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 plasticstudio/modulemanager 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 plasticstudio/modulemanager 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Analytics chooser extensions for site settings.
CitaNZ's SilverStripe picture object and field for SilverStripe 4
bootstrap select field module implementing http://silviomoreto.github.io/bootstrap-select/
Allows you to defined CMS form structure via config.yml
A module for adding a podcast or multiple podcasts to your SilverStripe site. With support for audio, video or other files.
统计信息
- 总下载量: 2.46k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2020-05-07