Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Excerpt tag to delimit excerpt in body?
I was thinking it would be convenient to have a textpattern block tag where I can delimit the portion of the body I want to use as the excerpt. Then, if no excerpt is specified, it will use which ever portion of the body is delimited by the excerpt tag.
I doubt this idea is original, any chance a plugin already exists?
Offline
#2 2013-04-10 02:35:42
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,477
Re: Excerpt tag to delimit excerpt in body?
Maybe this helps: rss_auto_excerpt
Offline
Re: Excerpt tag to delimit excerpt in body?
GugUser wrote:
Maybe this helps: rss_auto_excerpt
Thanks, I actually have used that! The key difference I’m proposing is that tags within the body define the excerpt rather than a count of characters, words, or paragraphs.
Offline
Re: Excerpt tag to delimit excerpt in body?
That’s very easy with etc_query
:
- add some class (say,
excerpt
) to theparagraphsportions (divs?) you want to use as excerpts; - put this in your article form:
<txp:if_excerpt>
<txp:excerpt />
<txp:else />
<txp:etc_query data='<txp:body />' query="//*[@class='excerpt']" />
</txp:if_excerpt>
Last edited by etc (2013-04-10 08:56:11)
Offline