A Build of the old Hacksaw plugin for EE3 since it was let go.
Switch branches/tags
Nothing to show
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
system/user/addons/chopper Update addon.setup.php Jan 4, 2018
README.md Update README.md Jul 8, 2016

README.md

bbd_chopper.ee_addon

A Build of the old Hacksaw plugin for EE3 since it was let go.

Click here to lend your support to: ExpressionEngine Chopper Addon and make a donation at pledgie.com !

BBD CHOPPER

If you ever used Brett DeWoody's EE Hacksaw, then you were probably sad to see it was labeled INACTIVE. I know I was. That's why I revived it in an ExpressionEngine 3 friendly version.

All of the functionality remains the same as it did with the older versions in EE2.

Chopper takes your entry's content and whittles it down to a more manageable size. It strips the HTML and limits the excerpts by character count, word count or cutoff marker.

To use Chopper simply wrap the content you want to truncate with the exp:chopper tag, like this:

{exp:chopper}
   {your_content}
{/exp:chopper}

There are several parameters you can use to control how the content is truncated. These options are:

chars = "" // Limit by number of characters words = "" // Limit by number of words cutoff = "" // Limit by a specific cutoff string append = "" // String to append to the end of the excerpt allow = "" // HTML tags you want to allow. Ex allow="<b><a>"

For example, if you want to limit your excerpt to 100 words you would do this:

{exp:chopper words="100"}
   {your_content}
{/exp:chopper}

By default Chopper will strip all HTML from your excerpt. 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 <p> and <b> tags:

{exp:chopper words="100" allow="<p><b>"}
   {your_content}
{/exp:chopper}

This would strip all HTML except paragraph (<p>) and bold (<b>) tags.

Another way to limit content is by a cutoff string. This is similar to the way Wordpress's "more" feature works. In your content you could add a specific string to indicate the spot you want the excerpt to stop. Let's say you use "<!--END-->". To cut the excerpt off at this location you would do this:

{exp:chopper cutoff="<!-- END -->"}
   {your_content}
{/exp:chopper}

The "cutoff" parameter can be coupled with the "words" parameter in case you forget to add the cutoff string to some of your entries. This way the excerpt will be truncated at the cutoff string, OR after X words.

You can add any string at the end of the excerpt using the "append" parameter, like this:

{exp:chopper words="100" append="..."}
   {your_content}
{/exp:chopper}

This would append "..." to the end of the excerpt.

I am not sure what all other addons this will work with right now since there are so few ready for EE3 right now.