Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-04-10 02:19:55

mericson
Member
Registered: 2004-05-24
Posts: 137
Website

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

#3 2013-04-10 03:30:51

mericson
Member
Registered: 2004-05-24
Posts: 137
Website

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

#4 2013-04-10 08:45:59

etc
Developer
Registered: 2010-11-11
Posts: 5,471
Website GitHub

Re: Excerpt tag to delimit excerpt in body?

That’s very easy with etc_query:

  • add some class (say, excerpt) to the paragraphs portions (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

Board footer

Powered by FluxBB