rss_auto_excerpt
Plugin Details
- Download:
- rss_auto_excerpt v0.5
- Textpattern Forum:
- View discussion
- Plugin Type:
- Regular
- Current Version:
- 0.5
- Status on this site:
- Active
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. You can also override this feature so that an auto-generated excerpt is always displayed even if an excerpt has been defined.
Features
There are 3 different options for auto-generating the excerpt from the article body:
- By Length – specify the number of characters to display from the article body
- By Words – specify the number of words to display from the article body
- By Paragraphs – specify the number of paragraphs to display from the article body
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.
Reverse excerpts
You can also use the plugin to generate a “reverse” excerpt by using the skip variants of the length attributes. For example:
<txp:if_individual_article>
<txp:rss_auto_excerpt skipparagraphs="1" paragraphs="9999" />
<txp:else />
<txp:rss_auto_excerpt paragraphs="1" />
</txp:if_individual_article>
This code would display the first paragraph of your article on an article listing page, but on an individual article page, you would see all paragraphs except the first.
The skip tags could also be used to apply different styling to you first paragraph (i.e., larger font size) or character (i.e., drop caps).
The plugin will also automatically close any open HTML tags. This will allow for proper handling of lists, bolded or italicized text and other situations. You can also choose to strip out all HTML tags from the excerpt.
rss_auto_excerpt tag attributes
length
The number of characters to display from the article body.
Default: “”
Example: length=“350”
words
The number of words to display from the article body.
Default: “”
Example: words=“50”
paragraphs
The number of paragraphs to display from the article body.
Default: “”
Example: paragraphs=“2”
linktext
The link text for the permlink to the full article.
Default: “Keep Reading…”
Example: linktext=“Read More”
ending
The text that will be displayed at the end of the excerpt when generating the excerpt by length or words. This is used to show that text is being truncated.
Default: “...”
Example: ending=”........”
linkwraptag
The HTML tag that wraps the permlink to the full article.
Default: “p”
Example: linkwraptag=“span”
linkclass
The class attribute on the linkwraptag.
Default: “”
Example: linkclass=“morelink”
linklabel
A label that appears before the permlink to the full article. It will appear outside the link tag.
Default: “”
Example: linklabel=”- “
excerptwraptag
The HTML tag that wraps the excerpt of the full article.
Default: “p”
Example: excerptwraptag=“span”
showlinkwithbody
Determines whether the permlink to the article will be shown when the article body is displayed because the generated excerpt is not shorter than the article body.
Default: “0”
Example: showlinkwithbody=“1”
showlinkwithexcerpt
Determines whether the permlink to the article will be shown when the automatic excerpt is displayed.
Default: “1”
Example: showlinkwithexcerpt=“0”
overrideexcerpt
Displays an automatic excerpt even if the article has an excerpt defined.
Default: “0”
Example: overrideexcerpt=“1”
striptags
Strips HTML tags from the automatic excerpt that is displayed.
Default: “0”
Example: striptags=“1”
skiplength
The number of characters to skip at the beginning of the display from the article body.
Default: “0”
Example: skiplength=“50”
skipwords
The number of words to skip at the beginning of the display from the article body.
Default: “0”
Example: skipwords=“2”
skipparagraphs
The number of paragraphs to skip at the beginning of the display from the article body.
Default: “0”
Example: skipparagraphs=“1”
excerpt
The field name to use for the article excerpt.
Default: “excerpt”
Example: excerpt=“custom1”
body
The field name to use for the article body.
Default: “body”
Example: body=“custom2”
