squirreldev/twig-matrix-match

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

Installs: 11

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:craft-plugin

pkg:composer/squirreldev/twig-matrix-match

1.1.0 2021-08-04 16:36 UTC

This package is not auto-updated.

Last update: 2025-12-19 12:21:56 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 %}