Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-06-22 04:09:54

blazin6543
Member
From: Toronto, Canada
Registered: 2006-06-19
Posts: 103
Website

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

#3 2006-06-22 05:29:12

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,350
Website GitHub Mastodon Twitter

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

#4 2006-06-22 16:35:07

blazin6543
Member
From: Toronto, Canada
Registered: 2006-06-19
Posts: 103
Website

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

#5 2006-06-22 17:29:39

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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:)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#6 2006-06-22 19:08:02

blazin6543
Member
From: Toronto, Canada
Registered: 2006-06-19
Posts: 103
Website

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

Board footer

Powered by FluxBB