Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-02-15 15:12:22

Bongo-man
Member
Registered: 2009-03-18
Posts: 243

Article number by category in a category list

How to get it shown beside each category?
Thanks,
BongoMan

Last edited by Bongo-man (2012-02-15 15:13:49)

Offline

#2 2012-02-15 15:41:43

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,315

Re: Article number by category in a category list

Use category_list as a form tag and put mem_article_count inside.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#3 2012-02-19 08:21:56

Bongo-man
Member
Registered: 2009-03-18
Posts: 243

Re: Article number by category in a category list

I can’t find where to download this plug-in. The download link looks to be no more available.

Last edited by Bongo-man (2012-02-19 21:51:32)

Offline

#4 2012-02-19 22:45:12

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: Article number by category in a category list

Offline

#5 2012-02-19 23:33:35

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,001
Website GitHub

Re: Article number by category in a category list

It is available on his bitbucket repo (here) but it’s in a raw plugin format. You can save this in your plugin_tmp directory (or whatever you set as plugin cache dir in the prefs) or you can use this compiled version I made from it:

# Name: mem_article_count v0.2 (compressed)
# Type: Admin/Public side plugin
# Returns the article count for the number of articles in a specific section and/or a category.
# Author: Michael Manfre
# URL: http://manfre.net/
# Recommended load order: 5

# .....................................................................
# This is a plugin for Textpattern - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the 'Install plugin' box:
# .....................................................................

H4sIAAAAAAAAA31UyW7bMBA9R18xJYxQKgzLVpLapZeiKHpMUTS9FYVBSyOLhSSqJBXHSPLv
JSXacRZUF5Jv3ixvOBRnk0t2r9klIzWvkMw1m0wZqbBac2VEWuI6lW1tnMHit6i0kLU7XTAy
HiVuN2NE4a04GMaMuOUDI7w1hVRdTBv/WqQFxxKueZ2rPtP4wFm3SnSIjVUY07A4rjraqEYT
d5YJIxnqVInG+EQfbQk/0LSq1mAKBF8wdAVDLlWH1m21QQUyP9g1iBo46AZTkYsUNKYuIvA6
i60Ph5Qb3Eq1H7kkV4xIlWGvgpErt1oxZt+ghyaelpd8q08a4NSVkmfrt/wLLBu3Ta4s62xR
TFY3bVVxtV/Edh8EZ4tm9bMQGpqy3dp6d6IsQXViO1W9RieqLBdx4z2+3vGqsR1otai3zgSN
1FpsLMSNUWLTGtRssVEQr4JFKjNcnZdmbu4a9urGD31Znv9tpeXgnWlsEFR1Dxzb5Al9od62
U7wxfOtNmbj1eHy+NfNF3GV2ZftBSvVp42x7HKEboo8JI3EM3/suOBi20l5hgXY2AL5JqBEz
MBLsbPAGweVBPQqCvK37e32tLBxYIToK7gOwnxWmeGrC8rMFQ64U34edwX3UK6F2v1wBpcMn
k2/QW6ZDb+gbXoabVtMzh1/SDo+GfUHRPOjOg52TB0voi3kO//ptDdTeq7G6F0uo5S6MqKeI
HMJ3WDVmHw76RBE8PIDfL5dLOqbRaSDSW9xuBFxrVGYtanP0nh/DDrzcF+7+8diSyCiTNyXX
xRN1RCg5iXDoyvMQ4RcPT15EOdJtGLAv88BL/sOLyKFZRhpeWqbmOa5zgWUW0u76w/cRHdKT
eaZD+CNFHVL3CwB76qs7Xod/duHAz0IEn8AuYZ9i+AQzn3UePPrBrrLuwV/YKU5nV9N8NuN5
wvPNBKd5kk1xghfJLM0202RM5o//AHJqlaONBQAA

Last edited by jakob (2012-02-19 23:36:30)


TXP Builders – finely-crafted code, design and txp

Offline

#6 2012-02-20 04:07:18

Bongo-man
Member
Registered: 2009-03-18
Posts: 243

Re: Article number by category in a category list

Thank you very much Jacob, I’ve used ‘mem_article_count v0.2’ and it works very good.
I haven’t put it in a form. I have placed it into this expression and endly it works:

<txp:category_list parent="blogpost" exclude="blogpost" children="0" type="article" label="<b>Article categories</b>" active_class="activecategory" labeltag="left" wraptag="p">
   <div>
      <a class="linkcat" href="<txp:site_url />index.php?c=<txp:category />">
         <txp:category title="1" /> (<txp:mem_article_count section="blogpost" category='<txp:category />' />)
      </a> 
      <txp:if_category name='<txp:category />'>
         <txp:article_custom category='<txp:category />' sort="Posted desc" limit="15">
            <div class="news">
               <txp:permlink><txp:title />,</txp:permlink>
            </div>
         </txp:article_custom>
      </txp:if_category>
   </div>
</txp:category_list>

{Added bc.. and indentation for better code display. – Uli}

Last edited by uli (2012-02-20 12:56:13)

Offline

Board footer

Powered by FluxBB