scarbous/mr_template
Composer 安装命令:
composer require scarbous/mr_template
包简介
Adds the functionality to use a configuration file for TS-Config and TypoScript in your template-extension.
关键字:
README 文档
README
What does it do?
EXT:mr_template helps you to organize your TypoScript and TSConfig in your Template-Extension.
Why have I created this Extension?
My goal when creating template extensions is to be able to reuse code easily and to configure as little as possible by hand.
With Mr.Template, I can create basic templates and build on them.
All TypoScripts and TSConfigs are loaded for the respective section of the page tree. (MultiPage support)
How to use?
-
Basically download and install the extension.
It is recommended to install it with composer. -
Create your Template-Extension your with the [folder structure](#Folder structure):
-
Create a
template.ymlin your Template-Extension and add the config like:
label: Sample Template parent: mr_template/base typoScript: - EXT:fluid_styled_content/Configuration/TypoScript - EXT:news/Configuration/TypoScript extensions: # Includes TypoScript in Extensions/[ExtsnsionName]/Configuration/TypoScript - fluid_styled_content - news tsConfig: # Can handle TSConfig Files or classes wich implements Scarbous\MrTemplate\Template\Entity\TsConfigInterface - EXT:sample_template/Configuration/TsConfig/Page/TCEMAIN.tsconfig
-
Define your "site root" and add one empty TypoScript Template to the "site root".
-
Select Template in Sites-Config under Tab "Mr.Template"
Folder structure
That the system can do the job your Template Extension needs the following folder structure:
sample_template
┣ Configuration
┃ ┣ MrTemplate
┃ ┣ default <- Template name, one Extension can handle multiple templates
┃ ┃ ┗ template.yml
┃ ┃
┃ ┗ TsConfig
┃ ┗ Page
┃ ┗ Mod
┃ ┗ WebLayout
┃ ┗ BackendLayouts <- Each BackendLayout get its one file.
┃ ┗ default.tsconfig
┃
┃ ┗ TypoScript <- Default TypoScript
┃ ┣ setup.txt
┃ ┗ constants.txt
┃
┣ Extensions <- Overrides for other extensions
┃ ┗ news
┃ ┗ Configuration
┃ ┗ TypoScript
┃ ┣ setup.txt
┃ ┗ constants.txt
┃
┗ Resources
┗ Private
┣ Layouts
┃ ┗ Page
┃
┣ Partials
┃ ┗ Page
┃
┗ Templates
┗ Page
Default TypoScript and TSConfig
Here are some simple Configs I use realy often in Template-Extensions.
TypoScript
EXT:mr_template/Configuration/TypoScript/Page
Add FluidPage Template based on BackendLayout-Name.
EXT:mr_template/Configuration/TypoScript/BackendLayoutBodyClass
Like the folder name say, add the BackendLayout name as class to the body-tag.
EXT:mr_template/Configuration/TypoScript/Config
Some basic configs with configurable constants like:
- caching
- concatenateJs
- concatenateCss
- compressJs
- compressCss
TSConfig
Scarbous\MrTemplate\Template\Entity\BackendLayouts
Adds all BackendLayout files under EXT:[sample_extension\]/Configuration/TsConfig/Page/Mod/WebLayout/BackendLayouts
scarbous/mr_template 适用场景与选型建议
scarbous/mr_template 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 146 次下载、GitHub Stars 达 3, 最近一次更新时间为 2021 年 04 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「template」 「extension」 「typo3」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 scarbous/mr_template 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 scarbous/mr_template 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 scarbous/mr_template 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A custom URL rule class for Yii 2 which allows to create translated URL rules
Set Links with a specific language parameter
The Yii2 extension uses jQuery jquery.carousel-1.1.min.js and makes image carousel from php array of structure defined.
TYPO3 CMS extension to create gallery content element with preset crop ratios and pagination
UI Kit 3 Extension for Yii2
Adds more BBCode
统计信息
- 总下载量: 146
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2021-04-05