Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
short description (resolved)
how do i go about have a short description instead of the entire article on the pages? and have a link like “read the rest” where it’ll goto the entire article as well as show the comment submission part
Last edited by blazin6543 (2006-06-27 21:53:25)
Offline
#2 2006-06-22 05:27:08
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: short description (resolved)
Use two forms, one for individual articles, the other for article lists. In the article lists form, use the excerpt tag. Then in your articles put something in the excerpt field.
Offline
Re: short description (resolved)
In your default form you can have something similar to:
<code><txp:if_individual_article>
<txp:body />
</txp:if_individual_article>
<txp:if_article_list>
<h2><txp:permlink><txp:title /></txp:permlink></h2>
<txp:excerpt />
<p><txp:permlink>read the rest</txp:permlink> <txp:comments_invite />
</txp:if_article_list></code>
Customise to taste:)
>oops, I was posting this in parallel with Mary whose suggestion presents another method:)
Last edited by colak (2006-06-22 05:30:46)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: short description (resolved)
Mary wrote:
Use two forms, one for individual articles, the other for article lists. In the article lists form, use the excerpt tag. Then in your articles put something in the excerpt field.
ok so let me get this straight, considering im new with textpattern and all. on the default page i put in the “individual articles” and “article lists” forms??? how will that show the excerpt on the main page and not the entire article?
Offline
Re: short description (resolved)
Hi blazin6543,
- Following Mary’s suggestion: in your default page put something like this:
<code>
<txp:article form=“full” listform=“excerpted” />
</code>
Then, create two article forms:
One (name it “full”) with all the article tags that you want to display when in individual-article context. (txp:body, txp:title, txp:author, etc).
The other one (name it “excerpted”) with all the article tags that you want to display when in article-list context (txp:excerpt, txp:title, etc).
- Following colak’s suggestion, do this:
<code>
<txp:article form=“default” />
</code>
You won’t need two forms, but one with conditionals.
As colak wrote:
In your default form you can have something similar to:
<code><txp:if_individual_article>
<txp:body />
</txp:if_individual_article>
<txp:if_article_list>
<h2><txp:permlink><txp:title /></txp:permlink></h2>
<txp:excerpt />
<p><txp:permlink>read the rest</txp:permlink> <txp:comments_invite />
</txp:if_article_list>
</code>
Customise to taste:)
Offline
Re: short description (resolved)
i got working but i think i used a different way http://forum.textpattern.com/viewtopic.php?id=14672 not sure if this is the same but it worked :) thanks all who posted :D
Offline
Pages: 1