PHPackages                             carbon/condition - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. carbon/condition

ActiveNeos-carbon[Utility &amp; Helpers](/categories/utility)

carbon/condition
================

This package provides some fusion helper for making writing conditions (`@if`) easier.

3.0.0(1y ago)358.9k↓36.4%5GPL-3.0

Since Jan 16Pushed 1y ago1 watchersCompare

[ Source](https://github.com/CarbonPackages/Carbon.Condition)[ Packagist](https://packagist.org/packages/carbon/condition)[ Fund](https://www.paypal.me/Jonnitto/20eur)[ GitHub Sponsors](https://github.com/jonnitto)[ RSS](/packages/carbon-condition/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (11)Used By (5)

[![Latest Stable Version](https://camo.githubusercontent.com/8aa23442133af2502eb3840a94136a08717e5ea8f70cfedd09c8b2ff70b10ca0/68747470733a2f2f706f7365722e707567782e6f72672f636172626f6e2f636f6e646974696f6e2f762f737461626c65)](https://packagist.org/packages/carbon/condition)[![Total Downloads](https://camo.githubusercontent.com/6c29bab8be6189975b17b638963902ada5ad32a424c9ceea1e48babc959e7331/68747470733a2f2f706f7365722e707567782e6f72672f636172626f6e2f636f6e646974696f6e2f646f776e6c6f616473)](https://packagist.org/packages/carbon/condition)[![License](https://camo.githubusercontent.com/71852758aaa2e4b7c0f3d670d7f5268f1713419b888e41fbbb1418c3f73f2b53/68747470733a2f2f706f7365722e707567782e6f72672f636172626f6e2f636f6e646974696f6e2f6c6963656e7365)](LICENSE)[![GitHub forks](https://camo.githubusercontent.com/61c1587ebeebc4a7cf2e0762735f924d0e6e6bd207f5afb3a4fa4415800d7c72/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f436172626f6e5061636b616765732f436172626f6e2e436f6e646974696f6e2e7376673f7374796c653d736f6369616c266c6162656c3d466f726b)](https://github.com/CarbonPackages/Carbon.Condition/fork)[![GitHub stars](https://camo.githubusercontent.com/365ad1c08e092b7d058df7db0521b3b5d08d068d321fc54241746eb495df7384/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f436172626f6e5061636b616765732f436172626f6e2e436f6e646974696f6e2e7376673f7374796c653d736f6369616c266c6162656c3d5374617273)](https://github.com/CarbonPackages/Carbon.Condition/stargazers)[![GitHub watchers](https://camo.githubusercontent.com/2ec070d7fa6eb1421e0d21c4bb6ca34e571f7dd81f10fba5ab5a87fb811eebf3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f77617463686572732f436172626f6e5061636b616765732f436172626f6e2e436f6e646974696f6e2e7376673f7374796c653d736f6369616c266c6162656c3d5761746368)](https://github.com/CarbonPackages/Carbon.Condition/subscription)

Carbon.Condition Package for Neos CMS
=====================================

[](#carboncondition-package-for-neos-cms)

This package provides some fusion helper for making writing conditions (`@if`) easier.
You can look at a real world example [here](https://github.com/jonnitto/Jonnitto.Plyr/blob/master/Resources/Private/Fusion/Prototypes/IncludeCase.fusion)

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

[](#installation)

`Carbon.Condition` is available via packagist. Add `"carbon/condition" : "^2.0"`to the require section of your composer.json or run `composer require carbon/condition`.

`Carbon.Condition:Case`
-----------------------

[](#carbonconditioncase)

[Link to the fusion file](Resources/Private/Fusion/Helper/Case.fusion)
Return true if a content element or a node type definition is on a document.
Example usage:

```
value = 'FooBar'
value.@if.render = Carbon.Condition:Case {
    content {
        nodeType = 'Foo.Bar:NodeType'
        propertyFilter = '[row != "one"]'
    }
}
```

In the example above the value `FooBar` gets only rendered if a content node type `Foo.Bar:NodeType` with the property `row` set not to `one` is on the current document.

```
value = 'FooBar'
value.@if.render = Carbon.Condition:Case {
    document.nodeType = 'Foo.Bar:MixinNodeType'
}
```

In the example above the value `FooBar` gets only rendered if the document has the mixin `Foo.Bar:MixinNodeType`.

You can also mix the conditions:

```
value = 'FooBar'
value.@if.render = Carbon.Condition:Case {
    content {
        nodeType = 'Foo.Bar:MixinLightbox'
        propertyFilter = '[lightbox=true]'
    }
    document {
        nodeType = 'Foo.Bar:MixinLightbox'
        propertyFilter = '[lightbox=true]'
    }
}
```

In the example above the value `FooBar` gets only rendered if the document or a content element has the mixin `Foo.Bar:MixinLightbox` and the property `lightbox`set to `true`.

### Default values

[](#default-values)

```
node = ${documentNode}

enabled = true

content {
    collection = '[instanceof Neos.Neos:ContentCollection]'
    nodeType = null
    propertyFilter = ''
    filter = ${this.nodeType ? ('[instanceof ' + this.nodeType + ']' + this.propertyFilter) : null}
}

document {
    nodeType = null
    propertyFilter = ''
    filter = ${this.nodeType ? ('[instanceof ' + this.nodeType + ']' + this.propertyFilter) : null}
}

context {
    backend = true
    live = false
}
```

### Overview of properties:

[](#overview-of-properties)

PropertyDescription`node`The node as starting point for the query`enabled`If set to `false`, it return always `false``content.nodeType`Set the node type`content.propertyFilter`This string gets appended to the `content.filter`. Example usage see above`content.collection`The filter string for the content collection. *Normally you don't need to change this property.*`content.filter`The filter string for the content element. *Normally you don't need to change this property.*`document.nodeType`Set the node type`document.propertyFilter`This string gets appended to the `document.filter`. Example usage see above`document.filter`The filter string for the document element. *Normally you don't need to change this property.*`context.backend`If set to `true`, the value is always return `true` in backend context`context.live`If set to `true`, the value is always return `true` in live context`Carbon.Condition:Properties`
-----------------------------

[](#carbonconditionproperties)

[Link to the fusion file](Resources/Private/Fusion/Helper/Properties.fusion)
Helper for checking if the element should get rendered or not. Example usage:

```
@if.render = Carbon.Condition:Properties {
    properties = 'title,image'
}
```

In the example above the condition is only get `true` if the node has `title` and `image` set.

### Default values

[](#default-values-1)

```
node = ${node}

properties = null
operator = 'AND'

context {
    backend = true
    live = false
}
```

### Overview of properties:

[](#overview-of-properties-1)

PropertyDefault valueDescription`node``${node}`The node as starting point for the query`properties``false`Set the needed properties as comma seperated string. You can mix string and object based properties.`operator``'AND'`If set to `'AND'` or `'&&'`, **all** properties have to be set. If it set to `'OR'` or `'||'` only **one** property is needed`context.backend``true`If set to `true`, the value is always return `true` in backend context`context.live``false`If set to `true`, the value is always return `true` in live context

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance47

Moderate activity, may be stable

Popularity31

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 96.4% 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 ~294 days

Recently: every ~570 days

Total

10

Last Release

392d ago

Major Versions

1.1.5 → 2.0.02022-03-29

2.0.0 → 3.0.02025-04-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/5fec51ac160a110a31a72a54ac29e276a447d8306205a052d35491ac9cf0589b?d=identicon)[jonnitto](/maintainers/jonnitto)

---

Top Contributors

[![jonnitto](https://avatars.githubusercontent.com/u/4510166?v=4)](https://github.com/jonnitto "jonnitto (27 commits)")[![daniellienert](https://avatars.githubusercontent.com/u/642226?v=4)](https://github.com/daniellienert "daniellienert (1 commits)")

---

Tags

carbonconditionneoscmspackagehelpercarbonflowNeosconditionFUSION

### Embed Badge

![Health badge](/badges/carbon-condition/health.svg)

```
[![Health](https://phpackages.com/badges/carbon-condition/health.svg)](https://phpackages.com/packages/carbon-condition)
```

###  Alternatives

[carbon/includeassets

Include your assets (css, js) in an easy way into Neos

14228.6k10](/packages/carbon-includeassets)[shel/neos-colorpicker

A plugin for Neos CMS which provides a colorpicker editor

1494.4k6](/packages/shel-neos-colorpicker)[shel/neos-hyphens

A plugin for Neos CMS which provides hyphens for the inline editor

20200.7k1](/packages/shel-neos-hyphens)

PHPackages © 2026

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