Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-06-27 19:39:31

moggie
Member
Registered: 2008-06-27
Posts: 11

showing only article exceprts

Hi,

In a section on the site I would like to display only the article excerpt (if it has one), and maybe something else if it doesn’t, but I’ll worry about that later. So I created a new form called ‘article_excerpt’, of type ‘article’ that just contains:

<txp:excerpt />

I then went to my page template and added this tag to my XHTML code and hoped that would do the job:

<txp:article form="article_excerpt" limit="1" listform="article_excerpt" pgonly="1" />

This seemed to sort of do what I wanted, in that it would indeed display the article’s excerpt if it had one, or nothing if it was an article list; but it would also show the article’s comments, or tell me commenting is disabled – I really wanted it to only display the article excerpt on its own. Could anyone please tell me what I have done wrong?

Thank you in advance for your time and consideration.

Regards,
Moggie.

Offline

#2 2008-06-27 19:49:08

whaleen
Member
From: Portland
Registered: 2006-05-11
Posts: 373
Website

Re: showing only article exceprts

You can turn commenting off under the Admin Prefs. If you need it in other areas of your site this is not an option so you would need to edit the comments_display form I believe. That form returns those unwanted ‘text items’.


txtstrap (Textpattern + Twitter Bootstrap + etc…)

Offline

#3 2008-06-27 19:57:06

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: showing only article exceprts

Ah, whaleen was faster.
In your prefs you can affect comments behavior. At the moment it’s set to “On by default” and “Automatically append comments to articles”. (FAQ)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#4 2008-06-27 19:58:31

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: showing only article exceprts

More precise: Admin > Preferences.
If you don’t want to use comments at all: Accept comments? no
If you want comments, but not everywhere: Automatically append comments to articles? no

Edit: too late. Uli again… ;)

Last edited by els (2008-06-27 19:59:33)

Offline

#5 2008-06-27 20:02:12

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: showing only article exceprts

*scramble* ;))


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#6 2008-06-27 20:10:49

whaleen
Member
From: Portland
Registered: 2006-05-11
Posts: 373
Website

Re: showing only article exceprts

If you want comments, but not everywhere: Automatically append comments to articles? no

I never asked myself what that did. I feel silly now.


txtstrap (Textpattern + Twitter Bootstrap + etc…)

Offline

#7 2008-06-27 20:44:38

moggie
Member
Registered: 2008-06-27
Posts: 11

Re: showing only article exceprts

After a bit of template/form jiggerypokery it’s all sorted now, comments appearing where I want them, and not where I don’t. Thanks everyone!

Offline

Board footer

Powered by FluxBB