Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
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
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
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
Re: Back to basics. txp:article list by category
GugUser wrote:
Mentioned in the first post buddy – can’t use it due to ob1_pagination,
Offline
Re: Back to basics. txp:article list by category
Maybe smd_query could help you?
Offline
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
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
Offline
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