Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#11 2018-03-04 12:08:41
- etc
- Developer
- Registered: 2010-11-11
- Posts: 3,410
- Website
Re: simple plugin for counting articles
Gallex wrote #309617:
how you would use it on section list?
phiw13 wrote #309625:
How do you make it count the number of articles. I can only make it count the number of pages on a section (list / landing) or search page.
To count articles, call it with pageby="1"
attribute (this will not alter the pagination). To limit the count to some sections (categories, etc), set them in <txp:article_custom />
as usual:
<txp:article_custom section='<txp:section />' pgonly pageby="1" />
Offline
#12 2018-03-04 12:11:08
- phiw13
- Plugin Author
- From: Japan
- Registered: 2004-02-27
- Posts: 1,753
- Website
Re: simple plugin for counting articles
etc wrote #309630:
To count articles, call it with
pageby="1"
attribute (this will not alter the pagination). To limit the count to some sections (categories, etc), set them in<txp:article_custom />
as usual:
<txp:article_custom section='<txp:section />' pgonly pageby="1" />...
Aha, pageby="1"
, that is what I missed! Thank you for the hint sir.
Offline
#13 2018-03-04 12:14:56
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,148
Re: simple plugin for counting articles
colak wrote #309609:
Hi Gallex
The edited version below works on one of my txp 4.6.2 sites
can’t figure out anymore, where i should insert the <txp:mdn_count />
in my section list code:
<txp:section_list break="" default_title="Home" include_default="0" sections="houses,apartments,farms" wraptag="ul" class="sub">
<li<txp:if_section name='<txp:section />'> class="active"</txp:if_section>><txp:section link="1" title="1" /></li>
</txp:section_list>
to achieve this:
- houses (5)
- apartments (12)
- farms (4)
Offline
#14 2018-03-04 12:24:58
- etc
- Developer
- Registered: 2010-11-11
- Posts: 3,410
- Website
Re: simple plugin for counting articles
Right after the sections? I don’t know mdn_count
, though:
<txp:section_list break="" default_title="Home" include_default="0" sections="houses,apartments,farms" wraptag="ul" class="sub">
<li<txp:if_section name='<txp:section />'> class="active"</txp:if_section>><txp:section link="1" title="1" /> (<txp:mdn_count section='<txp:section />' />)</li>
</txp:section_list>
Offline
#15 2018-03-04 12:51:29
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,148
Re: simple plugin for counting articles
etc wrote #309637:
Right after the sections? I don’t know
mdn_count
, though:
<txp:section_list break="" default_title="Home" include_default="0" sections="houses,apartments,farms" wraptag="ul" class="sub">...
yep, thank you!
Offline