Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-03-22 16:39:51

ogdehpes
New Member
Registered: 2009-03-22
Posts: 1

problem with article limit parameter

On my main page, I have one main area (A) that displays the latest articles from all categories except for one (ideas). On the same page, the articles from the Ideas categories are displayed in a separate area (B).

I use the following line of code to limit area A to display only the latest 4 articles: <txp:article limit=“4” />

The trouble with this is that area A does not always display 4 articles (for example, right now it is only displaying 2 articles) because it counts articles categorized as Ideas in its limit=“4”.

So – how can I set area A to display the latest 4 articles but NOT count articles from the Ideas category in its count?

Thanks!

Offline

#2 2009-03-22 16:54:09

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

Re: problem with article limit parameter

Hi ogdehpes

did you try the article_custom tag?

something like <txp:article_custom section="a,b,c" limit="4"> and <txp:article_custom section="ideas" limit="4">


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2009-03-22 17:05:02

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,730
Website

Re: problem with article limit parameter

How are you making it omit the “ideas” category? If you’re skipping ideas within your article form, what you observe will happen as txp:article goes and gets 4 articles, then goes about displaying them and skips the one’s in the category you instructed.

Try using txp:article_custom instead with category attribute, omitting the one you don’t want from the comma-separated list (e.g. in the example below, cat3 has been omitted):

<txp:article_custom section='<txp:section />' category="cat1,cat2,cat4,cat5" />

The section='<txp:section />' is optional and just restricts to the currently displayed section.

(colak was quicker)


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB