zaengle/craft-conventions

Craft Conventions

5.0.0-beta.1 2024-03-06 13:39 UTC

README

Latest Stable Version Total Downloads Latest Unstable Version License

The Conventions plugin helps you maintain a consistent template structure both within and across your Craft CMS projects, by making it easy to define and use twig helper functions that act as improved replacements for Twig's native {% include %} tag. These functions are designed to help you write cleaner, more consistent templates with less boilerplate.

Turn this:

{% include('_components/blog/card') with { data: myData } only %}

Into this:

{{ component('card/blog', { data: myData }) }}

with just a single line definition in a config file.

Features

  • Works out-of-the-box with default options
  • Flexible config options
  • Easily customisable for advanced use-cases

How to use

Read the documentation

Conventions Roadmap

  • Tests!
  • Add generators for scaffolding new patterns
  • Styleguide generator intergration 🧐

Brought to you by Zaengle Corp