Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-04-04 19:41:56

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Output articles that use sub-categories of current category

Imaging we have such category structure:

parent_cat
 - sub_cat
 - another_sub_cat
  1. We go to url site.by/?c=parent_cat
  2. In such case tag <txp:article /> shows only articles that have picked parent_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

#2 2010-04-04 19:46:00

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

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

#3 2010-04-04 20:03:21

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

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

#4 2010-12-09 09:33:02

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

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

#6 2010-12-09 21:52:02

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

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 point txp:article to filter children categories too?

chh_article_custom has an attribute children, maybe you can copy the code?

Offline

Board footer

Powered by FluxBB