Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-08-22 09:58:26

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Back to basics. txp:article list by category

Morning peeps!

You can filter txp:article by status, custom fields, time and keywords, but not categories! Strange omission.

I can’t use article_custom due to ob1_pagination. Is there a clever way round this (I need to either include two categories, or exclude one) using txp:article?

Does chh_article_custom work with the latest TXP and ob1_pagination?

Help would be appreciated!

Offline

#2 2012-08-22 15:19:01

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,340
Website GitHub Mastodon

Re: Back to basics. txp:article list by category

rossharvey wrote:

You can filter txp:article by status, custom fields, time and keywords, but not categories! Strange omission.

This is by design: The current category is conveyed by the URL your visitor is requesting.

Offline

#3 2012-08-22 16:24:52

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: Back to basics. txp:article list by category

I can work around it using the article status.

Last edited by rossharvey (2012-08-22 16:27:32)

Offline

#4 2012-08-22 16:36:36

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: Back to basics. txp:article list by category

Actually, I can’t.

Gah, something so simple!

Offline

#5 2012-08-22 16:51:12

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,477

Re: Back to basics. txp:article list by category

Offline

#6 2012-08-22 16:59:30

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: Back to basics. txp:article list by category

GugUser wrote:

<txp:article_custom />

Mentioned in the first post buddy – can’t use it due to ob1_pagination,

Offline

#7 2012-08-22 17:08:21

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

Re: Back to basics. txp:article list by category

Maybe smd_query could help you?


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#8 2012-08-22 21:17:27

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: Back to basics. txp:article list by category

Could you just go ahead and use txp:article_custom and replace ob1_pagination with a jQuery solution like jPaginate?

Offline

#9 2012-08-22 21:43:56

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,477

Re: Back to basics. txp:article list by category

Offline

#10 2012-08-23 17:05:21

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: Back to basics. txp:article list by category

Is it possible to filter txp:article by excluding a keyword?

I.e. <txp:article section="weddings" keywords="!archive"/>

(To return all except those with archive keyword)

Last edited by rossharvey (2012-08-23 17:06:07)

Offline

#11 2012-08-23 17:29:20

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,477

Re: Back to basics. txp:article list by category

This page lists articles from various sections, filtered according to defined categories. The pagination was made according to these proposal.

Offline

#12 2012-08-24 06:14:29

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

Re: Back to basics. txp:article list by category

rossharvey wrote:

Is it possible to filter txp:article by excluding a keyword?

I.e. <txp:article section="weddings" keywords="!archive"/>

(To return all except those with archive keyword)

Hi Ross,you could try

<txp:variable name="key-archive" value='<txp:article_custom section="weddings" keywords="archive" break="," limit="999"><txp:article_id /></txp:article_custom>' />
<txp:if_article_id id='<txp:variable name="key-archive" />' >
<txp:hide>for any articles having the keyword 'archive' show nothing</txp:hide>
<txp:else />
<txp:article>
your tags
</txp:article>
</txp:if_article_id>

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

Offline

Board footer

Powered by FluxBB