MD Eexcerpt
Creates excerpts after stripping out tags.
Download MD Eexcerpt 1.1.0
This version posted March 6, 2009
This ExpressionEngine add-on is available at GitHub.
Visit the GitHub page and click "Download", and then click either "Zip" or "Tar".
To make decent excerpts, I needed something that stripped out all tags first and then limited the remaining words, all in one fell swoop, so I combined those functions into one plugin. Rick Ellis originally wrote Word Limit, then Vik Rubenfeld modified that into Word Limit Plus. I took Vik’s modification and added some HTML stripping for your eexcerpting pleasure.
For some background on this plugin, you can review these threads:
Autogenerating an excerpt when a summary doesn’t exist
Definitive answer on Filter_HTML status, update or alternative, please?
USAGE
Wrap anything you want to be processed between the tag pairs. Works exactly like word_limit_plus, but strips tags.
{exp:md_eexcerpt if_exceeds="600" stop_after="500"
the_link="<a href='{title_permalink=news/item}'>MORE...</a>"}
text you want processed
{/exp:md_eexcerpt}
REFERENCE:
if_exceeds – Text will be truncated if it is greater than this number of words. This parameter must be included.
stop_after – Text greater than the number of words contained in the if_exceeds parameter, will be truncated to the word length stored in the stop_after parameter. This parameter must be included. Must be less than the number of words in the if_exceeds parameter.
append – Optional. Will default to “…”, but you may change the output if desired. This will show before “the_link”.
the_link – Optional. A link back to the original article.
View the related thread at the EE Forums.
This entry was last updated March 28, 2009.
April 03rd, 2009
line 45, we had to add a semi-colon to … or IE7 would render “…” and not “...”
April 03rd, 2009
Thanks, Jason. I fixed that and uploaded the newest file to GitHub (same version number, though).