squirreldev/twig-matrix-match

Adds a Twig filter to match matrix fields handles with templates names

Maintainers

Package info

github.com/tilingue/craft-twig-matrix-match

Type:craft-plugin

pkg:composer/squirreldev/twig-matrix-match

Statistics

Installs: 11

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.1.0 2021-08-04 16:36 UTC

This package is not auto-updated.

Last update: 2026-04-10 13:38:27 UTC


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 %}