PHPackages                             ryanshrum/hacksaw - 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. ryanshrum/hacksaw

AbandonedArchivedCraft-plugin[Utility &amp; Helpers](/categories/utility)

ryanshrum/hacksaw
=================

A simple text truncation plugin for Craft CMS.

2.0.1(8y ago)321.9k2[2 issues](https://github.com/ryanshrum/hacksaw/issues)PHP

Since Sep 13Pushed 8y ago2 watchersCompare

[ Source](https://github.com/ryanshrum/hacksaw)[ Packagist](https://packagist.org/packages/ryanshrum/hacksaw)[ RSS](/packages/ryanshrum-hacksaw/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

#### Notice (4/17/2018):

[](#notice-4172018)

Unfortunately, due to not working with Craft anymore and a lack of time, I haven’t been able to get Hacksaw updated for [Craft 3](https://craftcms.com/news/craft-3). I would recommend NY Studio's [Tyopgrify](https://github.com/nystudio107/craft-typogrify) or Top Shelf Craft’s [Wordsmith](https://wordsmith.docs.topshelfcraft.com/) (which includes native backwards compatibility for Hacksaw).

Additionally, if you would like to takeover as the maintainer of Hacksaw, please let me know and I will handover the reins.

---

Hacksaw for Craft CMS
=====================

[](#hacksaw-for-craft-cms)

A simple text truncation plugin for [Craft CMS](https://craftcms.com/) that takes your content and hacks it down to more manageable sizes.

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

[](#installation)

To install Hacksaw, follow these steps:

1. Download &amp; unzip the file and place the `hacksaw` directory into your `craft/plugins` directory
    **-OR-**
     Do a `git clone https://github.com/ryanshrum/hacksaw.git` directly into your `craft/plugins` folder. You can then update it with `git pull`
    **-OR-**
     Install with Composer via `composer require ryanshrum/hacksaw`
2. Install plugin in the Craft Control Panel under Settings &gt; Plugins
3. The plugin folder should be named `hacksaw` for Craft to see it. GitHub recently started appending `-master` (the branch name) to the name of the folder for zip file downloads.

Usage
-----

[](#usage)

Hacksaw is a Twig filter that accepts the following parameters:

ParameterTypeDefaultDescriptionhackstring`'p'`What you want to hack on (`'characters'`, `'words'` or `'paragraphs'` - can also use first letter as short hand `'c'`, `'w'` or `'p'`)limitint`1`Starting point for chars limit (used with chars param)allowstring`null`Sometimes there are HTML tags in your content that you don' removed, pass them hereappendstring`null`String to append to the end of the excerpt***Note:** Cutoff has been deprecated from Hackasw.*

Examples
--------

[](#examples)

Hacking by paragraphs is default, so if you wanted to limit your text to 5 paragraphs, you would only need to set the limit parameter:

```
{{ entry.richTextField|hacksaw(limit='5') }}

```

If you wanted to limit to 50 characters or words, you'd use both the hack and limit parameter:

```
{{ entry.richTextField|hacksaw(hack='characters', limit='50') }}

```

```
{{ entry.richTextField|hacksaw(hack='words', limit='50') }}

```

Hacksaw will strip all HTML from your excerpt by default. If you would like to keep some basic HTML you can use the `allow` parameter to keep specific HTML tags. For example, let's say you want to keep `` and `` tags:

***Note:** ``'s are automatically allowed when hacking by paragraph.*

```
{{ entry.richTextField|hacksaw(limit='10', allow='') }}

```

**Note:** If you are including HTML in the append parameter, the elements must be present in the `allow` parameter. If you are including a Craft variable in any parameter, it must be added using the Twig concatenation operator, `~`. Example of both:

```
{{ entry.richTextField|hacksaw(hack='w', limit='100', allow='', append='Continue...') }}

```

Brought to you by [Ryan Shrum](http://ryanshrum.com)

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 60% 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 ~286 days

Total

2

Last Release

3240d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/26708f2f1e81890699ca9697a9864fb23b478a181f291b70f644ae085e0a9ec5?d=identicon)[ryanshrum](/maintainers/ryanshrum)

---

Top Contributors

[![benface](https://avatars.githubusercontent.com/u/1059139?v=4)](https://github.com/benface "benface (3 commits)")[![ryanshrum](https://avatars.githubusercontent.com/u/1153690?v=4)](https://github.com/ryanshrum "ryanshrum (2 commits)")

---

Tags

craftcmscraftcms-pluginhacksawphp

### Embed Badge

![Health badge](/badges/ryanshrum-hacksaw/health.svg)

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

###  Alternatives

[rainlab/blog-plugin

Blog plugin for October CMS

17257.7k](/packages/rainlab-blog-plugin)[rainlab/builder-plugin

Builder plugin for October CMS

17147.2k1](/packages/rainlab-builder-plugin)[pfefferle/wordpress-activitypub

The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.

5671.4k1](/packages/pfefferle-wordpress-activitypub)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

18238.1k2](/packages/civicrm-civicrm-drupal-8)[mediawiki/semantic-glossary

A terminology markup extension with a Semantic MediaWiki back-end

1352.4k](/packages/mediawiki-semantic-glossary)[humanmade/lottie-lite

A lightweight Lottie Animations Extension for WordPress

374.3k](/packages/humanmade-lottie-lite)

PHPackages © 2026

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