Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2008-05-27 17:47:00
- alex9142
- Member
- Registered: 2008-03-17
- Posts: 45
the excerpt
Hi!
I never use the excerpt, only the article form. But today I tried to add an excerpt and the blog displayed the entire article. Why?
Offline
#2 2008-05-27 18:12:00
- masa
- Member
- From: Asturias, Spain
- Registered: 2005-11-25
- Posts: 1,091
Re: the excerpt
I suppose you want to list only the excerpts on an article listing with a Read more… link?
If so you need to differentiate in your article form whether a listing is displayed or an individual article using something like…
<txp:if_article_list>
<div class="excerpt">
<h2><txp:permlink><txp:title /></txp:permlink></h2>
<txp:excerpt />
<p><txp:permlink>Read more…</txp:permlink></p>
</div>
</txp:else />
<h2><txp:title /></h2>
<txp:body />
</txp:if_article_list>
Would that work?
Offline
#3 2008-05-27 18:13:36
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: the excerpt
“body” tags and “excerpt” tags are both article tags included in your article form. If you post text to both, both will be returned if both those tags are in your article form.
Offline
#4 2008-05-27 22:26:46
- alex9142
- Member
- Registered: 2008-03-17
- Posts: 45
Re: the excerpt
Hi Martin Sammtleben! Hi Rick Silletti!
I am sending you a link that shows what I was trying to say:
http://thebombsite.com
In this textpattern blog, the author writes a while, and then you click on the “read the full article…” link and you see the entire article.
Offline
#5 2008-05-27 22:29:28
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: the excerpt
Read a little bit more on thebombsite.com and you will find How to use excerpts :)
Offline
#6 2008-05-27 22:41:06
- masa
- Member
- From: Asturias, Spain
- Registered: 2005-11-25
- Posts: 1,091
Re: the excerpt
Els wrote:
Read a little bit more on thebombsite.com and you will find How to use excerpts :)
Yes, that example Els pointed out goes a step further in checking first if there’s an excerpt at all, otherwise it outputs the article body instead.
The basic principle remains the same: your article form needs to check whether it’s outputting a list or an individual article.
Offline
#7 2008-05-28 00:31:32
- alex9142
- Member
- Registered: 2008-03-17
- Posts: 45
Re: the excerpt
Hi !
This is what I have inside my form called “default” : (I’ve never changed this)
———————————————————————
<txp:if_individual_article>
<h1 class=“entry-title”>
<txp:permlink>
<txp:title />
</txp:permlink>
</h1>
<txp:else />
<h3 class=“entry-title”>
<txp:permlink>
<txp:title />
</txp:permlink>
</h3>
</txp:if_individual_article>
<p class=“published”><txp:posted /></p>
<div class=“entry-content”>
<txp:body /></div>
<address class=“vcard author”></address>
<p class=“tags”>Category: <txp:category1 title=“1” link=“1” />, <txp:category2 title=“1” link=“1” /></p>
<txp:comments_invite wraptag=“p” />
———————————————————-
Well, I tried to add those lines in the bombsite but the except is not shown…
Could someone write the right order of the lines to me? (I know, I am asking too much…)
Offline
#8 2008-05-28 00:54:35
- masa
- Member
- From: Asturias, Spain
- Registered: 2005-11-25
- Posts: 1,091
Re: the excerpt
Well, obviously the default form doesn’t include a <txp:excerpt />
tag anywhere, so you will need to create a new form using the bombsite’s code as a start.
Call it something like article_excerpt and in your page template change the <txp:article />
tag to <txp:article form="article_excerpt" />
to use your new form.
That should do the trick.
PS: it might be a good idea to read some basic documentation ;-)
Last edited by masa (2008-05-28 00:58:04)
Offline
#9 2008-05-28 21:01:49
- alex9142
- Member
- Registered: 2008-03-17
- Posts: 45
Re: the excerpt
Hi!
Thank you for your reply!
Offline
Pages: 1