Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-05-13 06:46:49

Distrahera
Member
Registered: 2008-09-20
Posts: 30

Perform a category content check

As the subject suggests, I am trying to list categories and their children assuming they have content assigned to them (articles). If the category and sub categories don’t have articles assigned to them, I don’t want to list any categories. Is there a way for textpattern to perform this check?

Something like:
<txp:if_category content="1">LIST OF ARTICLES IN CATEGORIES<txp:else/>NO ARTICLES</txp:if_category>

How could I solve this in another way?

Offline

#2 2009-05-13 08:17:20

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

Re: Perform a category content check

A better method is not to list empty categories at all
Here is Els’ code which works wonderfully.


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-05-14 07:07:44

Distrahera
Member
Registered: 2008-09-20
Posts: 30

Re: Perform a category content check

colak wrote:

A better method is not to list empty categories at all
Here is Els’ code which works wonderfully.

Seems about what I need, thank you!

Offline

Board footer

Powered by FluxBB