squirreldev/twig-matrix-match
Composer 安装命令:
composer require squirreldev/twig-matrix-match
包简介
Adds a Twig filter to match matrix fields handles with templates names
README 文档
README
A very simple plugin to match the matrix fields handles (camel case) with your templates (hypen format).
This plugin will be useful for you to perform a Layout-Builder system using matrix.
After installing this you will be able to do something like this in your entry template to theme up your matrix components:
{% set matrixBlocks = entry.yourMatrix.all() %}
{% for block in matrixBlocks %}
{% set blockType = block.getType().handle %}
{% include '_components/' ~ blockType | camelToHypens ~ '.html' %}
{% endfor %}
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-08-04