PHPackages                             drupal-pattern-lab/unified-twig-extensions - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. drupal-pattern-lab/unified-twig-extensions

ActiveDrupal-module[Templating &amp; Views](/categories/templating)

drupal-pattern-lab/unified-twig-extensions
==========================================

Share Pattern Lab's custom Twig extensions with Drupal 8.

v0.1.0(8y ago)9517.6k↓32.8%10[3 issues](https://github.com/drupal-pattern-lab/unified-twig-extensions/issues)[5 PRs](https://github.com/drupal-pattern-lab/unified-twig-extensions/pulls)1PHP

Since Aug 8Pushed 3y agoCompare

[ Source](https://github.com/drupal-pattern-lab/unified-twig-extensions)[ Packagist](https://packagist.org/packages/drupal-pattern-lab/unified-twig-extensions)[ RSS](/packages/drupal-pattern-lab-unified-twig-extensions/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)DependenciesVersions (3)Used By (1)Security (1)

Unified Twig Extensions
=======================

[](#unified-twig-extensions)

Share Pattern Lab's custom twigs functions, filters and tags with Drupal 8. Huzzah!

Getting Started
---------------

[](#getting-started)

Simply add to Drupal and enable the ` Unified Twig Extensions` module on the `admin/modules` page to get started.

Note on Paths
-------------

[](#note-on-paths)

Note: currently looks for compatible extensions in your current active D8 theme path + either the 'pattern-lab/source/\_twig-components' or 'source/\_twig-components' folders. @TODO: allow users to customized / override this!

Included Examples
-----------------

[](#included-examples)

I'm including a couple example twig extensions to add to your existing Pattern Lab-enabled theme to get started:

1. `example/_twig-components/functions/link.function.php` --&gt; example of having Drupal ignore a PL Twig extension given the link function already exists in Drupal.
2. `example/_twig-components/tags/grid.tag.php` and `example/_twig-components/tags/cell.tag.php` --&gt; example of a custom Twig tag that abstracts away some of the markup involved in an ITCSS-based grid system.

To test this out, try adding these two custom Twig tags to your theme's existing \_twig-components folder and try adding the following HTML (to both PL's twig templates and/or a Drupal template):

```
{% grid 'o-grid--large' %}
  {% cell 'u-1/1 u-1/2@small u-2/3@medium' %}
    Grid cell
  {% endcell %}

  {% cell 'u-1/1 u-1/2@small u-1/3@medium' %}
    Grid cell
  {% endcell %}
{% endgrid %}
```

Everything should be working as expected if you don't encounter any errors and the following HTML gets output (rendered of course):

```

    Grid cell

    Grid cell

```

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community14

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3251d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b3097fac15f816b756310b8660da0b23313f50a9c5dd0ad712b06234093cf747?d=identicon)[evanmwillhite](/maintainers/evanmwillhite)

![](https://www.gravatar.com/avatar/987cdfed8075c463b2a985c2b4e05b7041b4e97f243f77cc29e4c85a8791a515?d=identicon)[EvanLovely](/maintainers/EvanLovely)

![](https://www.gravatar.com/avatar/73b44976b3c063623653087ac776773b58867dea753f75138cfcdb7096872545?d=identicon)[sghoweri](/maintainers/sghoweri)

---

Top Contributors

[![sghoweri](https://avatars.githubusercontent.com/u/1617209?v=4)](https://github.com/sghoweri "sghoweri (6 commits)")

### Embed Badge

![Health badge](/badges/drupal-pattern-lab-unified-twig-extensions/health.svg)

```
[![Health](https://phpackages.com/badges/drupal-pattern-lab-unified-twig-extensions/health.svg)](https://phpackages.com/packages/drupal-pattern-lab-unified-twig-extensions)
```

###  Alternatives

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3851.2M](/packages/limenius-react-bundle)[area17/laravel-auto-head-tags

Laravel Auto Head Tags helps you build the list of head elements for your app

4616.1k](/packages/area17-laravel-auto-head-tags)[jelix/wikirenderer

WikiRenderer is a library to generate HTML or anything else from wiki content.

1712.3k1](/packages/jelix-wikirenderer)[webkinder/sproutset

A Composer package for handling responsive images in Roots Bedrock + Sage + Blade projects.

282.2k](/packages/webkinder-sproutset)[muratbsts/mail-template

This package is a easy to use mail template collection for Laravel 5.x.

191.3k](/packages/muratbsts-mail-template)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
