Musings

ExpressionEngine entry excerpts outside of the search page

11th November 2009

ExpressionEngine entry excerpts outside of the search page

If you need to use an excerpt for an entry perhaps inside an entry loop with several weblogs this plugin will automatically select the correct excerpt field then format and truncate it to a specified length.

I’ve just moved the code to GitHub, you can download it there and raise any issues you might have.

It works by using the search excerpt setting in Admin › Section Administration › Section Management › Edit Section Preferences › Administrative Preferences see the screenshot:

Settings screenshot

All you do is pass it an entry id and optionally a word limit and trailing string:

{exp:linssen_excerpt entry_id="{entry_id}" word_limit="10" trailer="... read more"}

Would result in “Quod littera Investigationes ii parum nunc. Amet suscipit hendrerit wisi… read more

It’s probably best to use it inside an entry loop, but you can happily send it a standalone entry id and it will work just fine, here’s the full code I recommend it with:

{exp:weblog:entries weblog="weblog"}
  {exp:linssen_excerpt entry_id="{entry_id}" word_limit="10" trailer="... read more"}
{/exp:weblog:entries}

I’d appreciate some feedback, just in case it’s buggy etc. so let me know!

Discuss

Get involved in the discussion by using the comment form below.

bayi

17th June 2010

Nice software to use. I like expression engine

Leave a comment

Your email is never ever shared, and required fields are marked with *

*

*

Used for Gravatars



Sorry folks, uses the "nofollow" attribute

*


My apologies for this nonsense: please type the word you see below.



Copyright © 2009 Wil Linssen all rights reserved

Wil-Linssen.com is powered by ExpressionEngine: it's good, go and get it.