Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-04-26 22:22:26

alittle116
Member
From: Brooklyn
Registered: 2005-09-14
Posts: 72
Website

controlling # of articles displayed

Hello, I have searched the forums for a solution but to no avail. I am sure this is a pretty common question though…

I would like to setup a conditional so that:

1. when a user is viewing the default page, only the single most recent article is displayed, regardless of what section it is from. This page is called Default.

2. when the user is viewing the default pages for one of two sections, only the the single most recent article from that respective section is displayed. These pages are called Default_Projects and Default_Information.

3. When the user is viewing a catergory, ALL articles in that category are displayed.

Does this make sense? Can any give me example code or lead me to a forum topic where this is covered? Thanks!!

Offline

#2 2006-04-26 22:52:58

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: controlling # of articles displayed

FAQ.

The if_category tag by itself (without a name attribute) will test whether or not the user is viewing a category.


Alex

Offline

#3 2006-04-26 22:59:38

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: controlling # of articles displayed

This should take care of 1&2, provided you have all sections marked as “Show on Frontpage” (Presentation>Sections)

<code>
<txp:article limit=“1” />
</code>

Last edited by deldindesign (2006-04-26 23:00:14)

Offline

Board footer

Powered by FluxBB