ttree/outofbandrendering
Composer 安装命令:
composer require ttree/outofbandrendering
包简介
A package to render Fusion Out of Band in complex application fun & easy
README 文档
README
This package provide some helpers to work with Fusion Out of Band rendering in Neos CMS
Package under development, API can change at any time
How to use ?
Edit your distribution Routes.yaml and add the required routes:
-
name: 'Ttree.OutOfBandRendering'
uriPattern: '<TtreeOutOfBandRenderingSubroutes>'
subRoutes:
'TtreeOutOfBandRenderingSubroutes':
package: 'Ttree.OutOfBandRendering'
variables:
'defaultUriSuffix': ''
With this configuration you can access the URL endpoint at http://www.domain.com/api/v1/rendering.
Check the Routes.yaml in this package, if you need a custom URL.
Make it work
The endpoint require two parameters:
- node: the node address of the rendering node (e.g.
{"contentRepositoryId":"default","workspaceName":"live","dimensionSpacePoint":{"language":"en"},"aggregateId":"dfdddebe-d4a9-40b5-b7e1-e071a8024174"}) - preset: the preset name, check below for information about Presets
You can create preset in two different ways, static presets in Settings.yaml and dynamic presets with your
own PHP implementation. A preset is mainly used to limit the Fusion path that can be rendered out of band.
Static Preset
To use static preset, just write something like this in your Settings.yaml:
Ttree:
OutOfBandRendering:
presets:
'marketplace:version':
path: 'root<Neos.Fusion:Case>/neosMarketPlaceDocument<Neos.Fusion:Matcher>/element<Neos.MarketPlace:Package>/body<Neos.Fusion:Template>/content/main<Neos.Fusion:Array>/package<Neos.MarketPlace:Package>/versions<Neos.MarketPlace:VersionPreview>'
The key marketplace:version is your preset name, and the path the allowed Fusion path to be rendered.
Dynamic Preset
A dynamic preset is more flexible and allow you to generate the Fusion path dynamically based on the given node.
You need a PresetDefintion object, the easy way is to extend the AbstractPresetDefinition like this:
use Ttree\OutOfBandRendering\Domain\Model\AbstractPresetDefinition; use Neos\ContentRepository\Domain\Model\NodeInterface; class CustomPresetPresetDefinition extends AbstractPresetDefinition { /** * @param NodeInterface $node * @return string */ public function getFusionPath(NodeInterface $node) { return 'page<Ttree.ArchitectesCh:DefaultPage>/body<Neos.Fusion:Template>/content/main<Neos.Neos:PrimaryContent>/enterpriseProfile<Neos.Fusion:Matcher>/element<Ttree.ArchitectesCh:EnterpriseProfile>/reportSection<Ttree.ArchitectesCh:EnterpriseProfileSection>/content<Ttree.ArchitectesCh:ReportMenu>'; } }
The PresetDefinitionInterface force you to defined the following methods:
- PresetDefinitionInterface::getPriority: Return an integer to define the preset priority (higher has more priority, like in the Flow Framework PropertyMapper
- PresetDefinitionInterface::getName: Return the name of the preset (used in the endpoint URL)
- PresetDefinitionInterface::canHandle: Receive the current document node as argument, and allow you to add more logic to decide if a preset can handle the given node
- PresetDefinitionInterface::getFusionPath: Receive the current document node as argument, must return the Fusion path to render
What's next ?
- Implement authorization support
- Add JS module to support content loading (appending, replacing, infinite scrolling, ...)
Acknowledgments
Development sponsored by ttree ltd - neos solution provider.
We try our best to craft this package with a lots of love, we are open to sponsoring, support request, ... just contact us.
License
Licensed under MIT, see LICENSE
ttree/outofbandrendering 适用场景与选型建议
ttree/outofbandrendering 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.34k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2016 年 04 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「neoscms」 「FUSION」 「flow-framework」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ttree/outofbandrendering 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ttree/outofbandrendering 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ttree/outofbandrendering 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Link helper for Neos CMS
Graphical analysis & visualizer for the Neos CMS nodetypes as backend module
This package provides some fusion helper for making writing conditions (`@if`) easier.
HTML Widget for the Neos CMS
Sync files from various sources to neos assets.
Fusion objects to generate a script tag
统计信息
- 总下载量: 1.34k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 9
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-04-02