PHPackages                             skylennard/bard-contains - 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. skylennard/bard-contains

ActiveStatamic-addon[Utility &amp; Helpers](/categories/utility)

skylennard/bard-contains
========================

Adds reliable custom conditions for Bard fields

v1.0.1(4y ago)1766[1 issues](https://github.com/skylennard/bard-contains/issues)MITJavaScript

Since Sep 9Pushed 4y ago1 watchersCompare

[ Source](https://github.com/skylennard/bard-contains)[ Packagist](https://packagist.org/packages/skylennard/bard-contains)[ Docs](https://github.com/skylennard/bard-contains)[ RSS](/packages/skylennard-bard-contains/feed)WikiDiscussions main Synced 3d ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Bard Contains
=============

[](#bard-contains)

This is a Statamic addon that extends on [Conditional Fields](https://statamic.dev/conditional-fields), so you can use the `bard-contains` custom rule against any Bard field.

As luck would have it, this works great everywhere - even in a repeater, or something much more obscure... such as a Bard-in-Bard-set onion!

Options
-------

[](#options)

This addon adds a `custom bard-contains:option` field condition to Statamic where `option` is one or more of the following:

- empty
- notEmpty
- hasParagraphs
- hasNoParagraphs
- hasSets
- hasNoSets
- debug (see [debugging](#debugging))

Multiple Options
----------------

[](#multiple-options)

You can use multiple options to test for ***all of the provided*** scenarios on your Bard field. This means you're using **AND** logic, so all options need to pass for the condition to succeed.

For instance, `custom bard-contains:hasParagraphs,hasSets` will only succeed if the Bard field has both a text paragraph and a set.

If you need to have a Bard condition succeed on either of multiple options, create separate conditions using `if_any`/`unless_any` operators.

From the Statamic Control Panel blueprint screens, these conditions are displayed as *Show/Hide when: any of the following conditions pass*.

How to Install
==============

[](#how-to-install)

You can search for this addon in the `Tools > Addons` section of the Statamic control panel and click **install**, or run the following command from your project root:

```
composer require skylennard/bard-contains
```

How to Use
==========

[](#how-to-use)

Add a condition to any field, referencing a bard field

- Use the "custom" condition syntax to set up the condition:
    - `custom bard-contains:option`, with an `option` from the above list

Example
-------

[](#example)

Fields in a Collection/Taxonomy, for instance:

```
    -
      handle: customize
      field:
        type: revealer
        if:
          custom_content: 'custom bard-contains:empty'
    -
      handle: custom_content
      field:
        type: bard
        if_any:
          customize: 'equals true'
          custom_content: 'custom bard-contains:notEmpty'
```

### Results

[](#results)

1. Revealer `customize` is only visible when Bard is empty.
2. Bard `custom_content` is visible when **either**:
    - Revealer `customize` is activated and/or
    - Bard `custom_content` has existing content.

Debugging
=========

[](#debugging)

Using the option `debug` can help you figure out what status the addon is seeing when checking your Bard field. This will `console.log()` an object with the true/false status for all the options, so check it out in the inspector.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

Every ~0 days

Total

2

Last Release

1706d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/84948671?v=4)[n8j](/maintainers/n8j)[@n8j](https://github.com/n8j)

---

Top Contributors

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

---

Tags

collectioncollectionstaxonomystatamicconditionstaxonomiesconditionbard

### Embed Badge

![Health badge](/badges/skylennard-bard-contains/health.svg)

```
[![Health](https://phpackages.com/badges/skylennard-bard-contains/health.svg)](https://phpackages.com/packages/skylennard-bard-contains)
```

###  Alternatives

[visuellverstehen/statamic-classify

A useful helper to add CSS classes to all HTML tags generated by the bard editor.

20116.8k](/packages/visuellverstehen-statamic-classify)[sylius/taxonomy-bundle

Flexible categorization system for Symfony.

26388.2k7](/packages/sylius-taxonomy-bundle)[marcorieser/statamic-livewire

A Laravel Livewire integration for Statamic.

2381.5k10](/packages/marcorieser-statamic-livewire)[withcandour/aardvark-seo

Save time and get your Statamic site to rank better with the SEO addon for Statamic.

13128.3k](/packages/withcandour-aardvark-seo)[aerni/livewire-forms

A Statamic forms framework powered by Laravel Livewire

2912.8k](/packages/aerni-livewire-forms)[mitydigital/feedamic

A fully-featured RSS and Atom feed generator for Statamic.

1064.0k](/packages/mitydigital-feedamic)

PHPackages © 2026

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