Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-07-31 21:02:17

cmscritic
Member
From: Edmonton, Alberta, Canada
Registered: 2009-07-09
Posts: 29
Website

Simple excerpt question.

I have the following code in my default form which has a number of class styles assigned. Right now, I have my page template calling this form which in turn displays 7 max articles in full (no excerpts).

I would like to use excerpts but am unsure how to modify this template to allow me to do so. Every time I have tried, I’ve ended up breaking something. Can someone please assist?

Code in my form at the moment is this:

<div class="post">
    <div class="title">
    	<h2><txp:permlink><txp:title /></txp:permlink></h2>
    </div>

    <div class="entry">
		<txp:body />
	</div><!-- end .entry -->

    <div class="postdata">
		Posted in <txp:category1 link=1 title=1 /> at <txp:posted />. <a href="<txp:permlink />#comment"><txp:comments_count /> Comments</a>.<br />

		<txp:if_individual_article>
			<txp:if_plugin name="tru_tags"><txp:tru_tags_if_has_tags>Tags: <txp:tru_tags_from_article /></txp:tru_tags_if_has_tags></txp:if_plugin>
		</txp:if_individual_article>
	</div>
</div><!-- end .post -->

<txp:if_individual_article>
			<txp:if_plugin name="tru_tags"><div class="post" id="related"><txp:related_articles label="Related Articles" Labeltag="h3" wraptag="ul" break="li" /></div></txp:if_plugin>
		</txp:if_individual_article>

Offline

#2 2009-07-31 21:09:59

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Simple excerpt question.

Simply place <txp:excerpt /> where you want the excerpt to appear. You’re getting the full post because of the <txp:body /> tag in the form.


Code is topiary

Offline

#3 2009-08-01 00:40:19

cmscritic
Member
From: Edmonton, Alberta, Canada
Registered: 2009-07-09
Posts: 29
Website

Re: Simple excerpt question.

Ok. I’ve add excerpt, and now if I click on the title of the post, I get the excerpt with comments.

Getting confused here.

Offline

#4 2009-08-01 02:01:30

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Simple excerpt question.

Do you have Automatically Append Comments to Articles set? That is the default value, and would explain why you are seeing comments when in individual article context (i.e., after clicking on an article title) even if there is no <txp:comments /> tag in your article form.


Code is topiary

Offline

#5 2009-08-01 11:08:19

cmscritic
Member
From: Edmonton, Alberta, Canada
Registered: 2009-07-09
Posts: 29
Website

Re: Simple excerpt question.

I have resolved. Thanks.

Offline

Board footer

Powered by FluxBB