Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Output articles that use sub-categories of current category
Imaging we have such category structure:
parent_cat
- sub_cat
- another_sub_cat
- We go to url site.by/?c=parent_cat
- In such case tag
<txp:article />
shows only articles that have pickedparent_cat
as their category1 or category2.
Is is possible to hook (using some callback, for example) to add subcategories to db-query?
The idea is to use default article tag. I know how to solve this case using <txp:article_custom />
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
Re: Output articles that use sub-categories of current category
Hi Victor
Posted this earlier today. Is it what you were looking for?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Output articles that use sub-categories of current category
Your example builds list of categories, subcatories and their articles. But i’m looking for a way to help tag <txp:article />
output articles that have picked subcategory of currently viewing parent category.
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
Re: Output articles that use sub-categories of current category
Maybe now there is solve for such case?
Last edited by the_ghost (2010-12-09 09:33:34)
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
#5 2010-12-09 19:56:39
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Output articles that use sub-categories of current category
Why would it be a problem for you to use article_custom?
Offline
Re: Output articles that use sub-categories of current category
It’s a kind of “not best fix”, i think. I have usual <txp:article />, usual pagination, usual markup and they work perfectly and look very logical. To use article_custom i have to add more “if’s” – if_this_category_has_children and others. And I have in this case to add more markup to make pagination work… It’s not txp-way. I believe! :)
I think, the closest (best) fix is to use soo_article_filter, but I have to think over this plugin more to understand how to call it for my needs.
Maybe there is some little <txp:php>
which can point txp:article
to filter children categories too?
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
#7 2010-12-10 00:24:43
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Output articles that use sub-categories of current category
the_ghost wrote:
…pagination…
Aha, I see.
Maybe there is some little
<txp:php>
which can pointtxp:article
to filter children categories too?
chh_article_custom has an attribute children
, maybe you can copy the code?
Offline