PHPackages                             nystudio107/craft-emptycoalesce - 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. nystudio107/craft-emptycoalesce

ActiveCraft-plugin[Templating &amp; Views](/categories/templating)

nystudio107/craft-emptycoalesce
===============================

Empty Coalesce adds the ??? operator to Twig that will return the first thing that is defined, not null, and not empty.

5.0.0(2y ago)28143.7k↓10.6%2[2 PRs](https://github.com/nystudio107/craft-emptycoalesce/pulls)3MITPHPPHP ^8.2

Since Jun 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/nystudio107/craft-emptycoalesce)[ Packagist](https://packagist.org/packages/nystudio107/craft-emptycoalesce)[ GitHub Sponsors](https://github.com/khalwat)[ RSS](/packages/nystudio107-craft-emptycoalesce/feed)WikiDiscussions develop-v5 Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (16)Used By (3)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/d2a804613d613deee55c915ab798f792e20066481caddc8ad6f9e5e351c96f98/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6e7973747564696f3130372f63726166742d656d707479636f616c657363652f6261646765732f7175616c6974792d73636f72652e706e673f623d7635)](https://scrutinizer-ci.com/g/nystudio107/craft-emptycoalesce/?branch=v5) [![Code Coverage](https://camo.githubusercontent.com/18b7283dd2c436b6b5bcc83079799473b53113e440935866a6ddacd7398f175b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6e7973747564696f3130372f63726166742d656d707479636f616c657363652f6261646765732f636f7665726167652e706e673f623d7635)](https://scrutinizer-ci.com/g/nystudio107/craft-emptycoalesce/?branch=v5) [![Build Status](https://camo.githubusercontent.com/22b57f7c1b0270268f1de31e114c7a166eb479ea1a58c1f2d4cb810b8c7ebcef/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6e7973747564696f3130372f63726166742d656d707479636f616c657363652f6261646765732f6275696c642e706e673f623d7635)](https://scrutinizer-ci.com/g/nystudio107/craft-emptycoalesce/build-status/v5) [![Code Intelligence Status](https://camo.githubusercontent.com/3da4bf3637a4f1835c77badbd129d5c3a1bb0df35098c2ccad0d0ad1d2c90e66/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6e7973747564696f3130372f63726166742d656d707479636f616c657363652f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d7635)](https://scrutinizer-ci.com/code-intelligence)

Empty Coalesce plugin for Craft CMS 5.x
=======================================

[](#empty-coalesce-plugin-for-craft-cms-5x)

Empty Coalesce adds the ??? operator to Twig that will return the first thing that is defined, not null, and not empty.

[![Screenshot](./docs/docs/resources/img/plugin-logo.png)](./docs/docs/resources/img/plugin-logo.png)

Requirements
------------

[](#requirements)

This plugin requires Craft CMS 5.0.0 or later.

Installation
------------

[](#installation)

To install the plugin, follow these instructions.

1. Open your terminal and go to your Craft project:

    ```
     cd /path/to/project

    ```
2. Then tell Composer to load the plugin:

    ```
     composer require nystudio107/craft-emptycoalesce

    ```
3. Install the plugin via `./craft install/plugin empty-coalesce` via the CLI, or in the Control Panel, go to Settings → Plugins and click the “Install” button for Empty Coalesce.

You can also install Empty Coalesce via the **Plugin Store** in the Craft Control Panel.

Documentation
-------------

[](#documentation)

Click here -&gt; [Empty Coalesce Documentation](https://nystudio107.com/plugins/empty-coalesce/documentation)

Empty Coalesce Roadmap
----------------------

[](#empty-coalesce-roadmap)

Some things to do, and ideas for potential features:

- Submit a PR to the Twig project to get it into core

Brought to you by [nystudio107](https://nystudio107.com/)

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community13

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 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

Every ~214 days

Recently: every ~154 days

Total

11

Last Release

765d ago

Major Versions

1.0.6 → 4.0.0-beta.12022-03-12

v4.x-dev → 5.0.02024-04-13

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7570798?v=4)[Andrew Welch](/maintainers/khalwat)[@khalwat](https://github.com/khalwat)

---

Top Contributors

[![khalwat](https://avatars.githubusercontent.com/u/7570798?v=4)](https://github.com/khalwat "khalwat (61 commits)")

---

Tags

coalescecoalescingcraft-plugincraft3craftcmsemptyoperatortwigtwigcraftcmscraft-pluginoperatoremptycoalescingcraft3coalesce

### Embed Badge

![Health badge](/badges/nystudio107-craft-emptycoalesce/health.svg)

```
[![Health](https://phpackages.com/badges/nystudio107-craft-emptycoalesce/health.svg)](https://phpackages.com/packages/nystudio107-craft-emptycoalesce)
```

###  Alternatives

[nystudio107/craft-twigpack

Twigpack is a bridge between Twig and webpack, with manifest.json &amp; webpack-dev-server HMR support

97341.4k17](/packages/nystudio107-craft-twigpack)[wbrowar/guide

A CMS Guide for Craft CMS.

6154.5k1](/packages/wbrowar-guide)[jalendport/craft-preparse

A fieldtype that parses Twig when an element is saved and saves the result as plain text.

1086.4k](/packages/jalendport-craft-preparse)[nystudio107/craft-templatecomments

Adds a HTML comment with performance timings to demarcate `{% block %}`s and each Twig template that is included or extended.

20108.4k3](/packages/nystudio107-craft-templatecomments)[viget/craft-classnames

Classnames plugin for Craft CMS

1115.5k1](/packages/viget-craft-classnames)

PHPackages © 2026

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