Automatic Article Excerpts in Textpattern
I’ve used both the kgr_safe_excerpt plugin and the Beginning plugin but in both cases, those plugins didn’t do things I wanted to do. So I developed the rss_auto_excerpt plugin to solve some of the problems I’ve had. Thanks does go out to the authors of those plugins as I was able to use some ideas from them.
Main Features
The rss_auto_excerpt plugin automatically displays article excerpts even if an excerpt has not been saved with an article. If for some articles you have defined an excerpt, your own excerpt will be displayed rather than the auto-generated excerpt. The excerpt can be automatically generated by length, number of words or number of paragraphs. Some other points of note:
- If auto-generating by length, the plugin will ensure that the excerpt does not cutoff in the middle of a word.
- If based on the parameters passed into the plugin, the excerpt would not be shorter than the entire article body, the body will be shown instead.
- Any open HTML tags are automatically closed which allows for proper handling of lists, bolded or italicized text and other situations.
Comments
21. August 2006
Cool , thanks for the plugins :)
kus
1. September 2006
Thnx for this. Looks great.
Is it possible to add an attribute so that your tag will generate an excerpt even if an excerpt already exists?
Why? It some instances, I’d like to use my quick, short excerpt with txp standard tag. I’d like to use your tag to generate a longer abstract, or intro, to an article.
Regardless, thanks for all your contributions to Txp!
3. September 2006
I want to give a second vote on Matthews issue. Please include a tag to force creation of an automatic ecerpt even if one exists.
Second I would like to add a feature request on top of that: Give an option list from which field(s) to create the auto excerpt from. I.e. first from excerpt, if not available from article. A more crazy version would include site parameters i.e. first date in brackets, second author in strong, third keywords or custom field or category1 followed by the excerpt. You get the picture :-)
I nearly always have excerpts with my articles. The excerpts are composed as a listed summary of the article headers (btw … that’s another feature request :).
I would use rss_auto_excerpt to only display the very first paragraph of my article which is always a h4 introduction.
I want my homepage (which is a W+W derivate btw) article list to look like: article title, 1st paragraph or line, date + section + category, keywords.
But this can only be achieved if rss_auto_excerpt would be able to create an excerpt even if a real excerpt already exists.
PS: I will copy this comment also to the forum
25. October 2006
First plugin that i use in my site, and i find a bug! lucky me!!!
If you go to my site, and try to go to the “first post” post, you’ll see what i mean.
It happens when the first word of the rest if the article is a link. In that case, instead of going to the post, it goes to the link.
I’m going to leave it like that for a couple of days.
Add a comment
You may use textile in your comment. Gravatars are enabled. Your email will not be displayed and will remain private. I reserve the right to edit or delete comments.
