squirreldev/twig-matrix-match

为 Twig 添加一个过滤器,用于匹配矩阵字段处理与模板名称

安装: 8

依赖: 0

建议: 0

安全: 0

星星: 0

关注者: 1

分支: 0

开放问题: 0

类型:craft-plugin

1.1.0 2021-08-04 16:36 UTC

This package is not auto-updated.

Last update: 2024-09-27 06:42:28 UTC


README

一个非常简单的插件,用于匹配矩阵字段处理(驼峰格式)与您的模板(连字符格式)。

此插件将有助于您使用矩阵执行布局构建器系统。

安装后,您可以在您的入口模板中执行类似以下操作来设计您的矩阵组件

{% set matrixBlocks = entry.yourMatrix.all() %}
{% for block in matrixBlocks %}
  {% set blockType = block.getType().handle %}
  {% include '_components/' ~ blockType | camelToHypens ~ '.html' %}
{% endfor %}