PHPackages                             kolaente/statamic-snippet - 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. kolaente/statamic-snippet

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kolaente/statamic-snippet
=========================

Adds a snippet modifier to statamic.

v1.1.2(4y ago)071.1kMITPHP

Since Dec 13Pushed 4y ago1 watchersCompare

[ Source](https://github.com/kolaente/statamic-snippet-addon)[ Packagist](https://packagist.org/packages/kolaente/statamic-snippet)[ RSS](/packages/kolaente-statamic-snippet/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (5)Used By (0)

Statamic snippet modifier addon
===============================

[](#statamic-snippet-modifier-addon)

This is a simple statamic addon which adds a `snippet` modifier to easily create a text snippet of a given string.

A snippet is an "intelligent substring": It will try to end the snippet at the end of a sentence (after a dot) within a given character boundary. If no sentence ends within the boundary, it will end after the first word in the boundary and add "..." to the end of the snippet. This will avoid having words cut off in the middle after a fixed boundary.

By default, the boundaries are a minimum of 200 and a maximum of 250 characters.

Usage
-----

[](#usage)

Use it in your antlers template like so:

```
{{ content | snippet }}

```

This will transform this text:

> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

into this:

> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.

### Modifying the boundaries

[](#modifying-the-boundaries)

The first parameter of the modifier is the min length, the second one is the max length.

For example, to create a snippet between 500 and 600 characters:

```
{{ content | snippet:500:600 }}

```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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 ~160 days

Total

4

Last Release

1539d ago

### Community

Maintainers

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

---

Top Contributors

[![kolaente](https://avatars.githubusercontent.com/u/13721712?v=4)](https://github.com/kolaente "kolaente (9 commits)")

### Embed Badge

![Health badge](/badges/kolaente-statamic-snippet/health.svg)

```
[![Health](https://phpackages.com/badges/kolaente-statamic-snippet/health.svg)](https://phpackages.com/packages/kolaente-statamic-snippet)
```

###  Alternatives

[grifart/enum

Provides bullet proof enums with behaviours.

22291.6k1](/packages/grifart-enum)

PHPackages © 2026

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