Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-03-06 16:16:15

geoff777
Plugin Author
From: Benarrabá Andalucía Spain
Registered: 2008-02-19
Posts: 282
Website

Counting Articles in Article Lists

Is there anyway to find the total number of articles in an article list.

If there isn’t a way in Textpattern does anyone know the PHP / mySQL to get a total of live articles for a section or a comma separated list of sections.

Thanks
Geoff


There are 10 types of people in the world: those who understand binary, and those who don’t.

Offline

#2 2009-03-06 16:19:53

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

Re: Counting Articles in Article Lists

Hi geoff, mdn_count works for me…


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-03-06 16:45:19

geoff777
Plugin Author
From: Benarrabá Andalucía Spain
Registered: 2008-02-19
Posts: 282
Website

Re: Counting Articles in Article Lists

Thanks Colak

I’ll take a look.

I did find a way using article_custom with a crazy limit and a form containing one line …

<txp:adi_calc name=“article_count” add=“1”/>

Obviously setting the variable to 0 before the article_custom tag.

Cheers Geoff


There are 10 types of people in the world: those who understand binary, and those who don’t.

Offline

#4 2009-03-07 22:25:16

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

Re: Counting Articles in Article Lists

It’s a bit hackish, but <txp:search_result_count /> prints the article count even if the article list is not the result of an actual search… Caveat: This is no official endorsement to rely on this behaviour for eternity.

Offline

Board footer

Powered by FluxBB