Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#85 2012-04-07 09:54:36

CeBe
Plugin Author
From: Caen - Fr
Registered: 2010-06-25
Posts: 345
Website

Re: mdn_count

Does something like that sound good ?

<txp:section_list break="" default_title="Home" include_default="1" sections="houses,farms,apartments,lands,commercial-real-estate,rent" wraptag="ul" class="sub">
  <txp:variable name="scount" value='<txp:mdn_count section=''<txp:section />'' />' />
  <txp:if_variable name="scount" value="0">
  <txp:else />
    <li<txp:if_section name='<txp:section />'> class="active"</txp:if_section>><txp:section link="1" title="1" /></li>
  </txp:if_variable>
</txp:section_list>

Offline

#86 2012-04-07 11:35:52

Gallex
Member
Registered: 2006-10-08
Posts: 1,289

Re: mdn_count

no…..i can’t see any counter number anywhere:(

Offline

#87 2012-04-07 12:46:10

Remillard
Plugin Author
From: Lenexa, KS
Registered: 2004-05-16
Posts: 169

Re: mdn_count

It’s my understanding that there is some sort of article count in the main codebase. I don’t know, however, if it does the counting by sections and whatnot. If anyone wants to take the code and create a patch, I’m sure the folks who hang out on the txp-dev mailing list would be happy to consider it. I’m personally not involved much with Textpattern anymore, but glad the plugin is still helpful to some folks.

Oh, perhaps I misunderstood the question, I only got an email summary and I“ll admit I didn’t read it very closely. I don’t know how well it would tie into other plugin usage there.

And very glad cain is keeping up with things and has added functionality to it.

Last edited by Remillard (2012-04-07 12:49:12)

Offline

#88 2012-04-07 12:51:46

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

Re: mdn_count

Does this work?

<txp:section_list break="" default_title="Home" include_default="1" sections="houses,farms,apartments,lands,commercial-real-estate,rent" 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>

Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#89 2012-04-07 13:59:52

Gallex
Member
Registered: 2006-10-08
Posts: 1,289

Re: mdn_count

working, and very well! thank’s colak!
but could you provide code for: display total number of articles under those sections: houses, farms, apartments, lands, commercial real estate, rent, as well?

Offline

#90 2012-04-07 14:01:49

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: mdn_count

Edit: not what you needed, sorry.

Last edited by els (2012-04-07 14:02:55)

Offline

#91 2012-04-07 14:28:56

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

Re: mdn_count

Gallex wrote:

working, and very well! thank’s colak!
but could you provide code for: display total number of articles under those sections: houses, farms, apartments, lands, commercial real estate, rent, as well?

Try <txp:php>echo safe_count('textpattern', 'Status = 4');</txp:php>

>Edit: the above code lists all published live articles

Alternatively I’m not sure if the plugin supports a comma delimited list

<txp:mdn_count section="houses,farms,apartments,lands,commercial-real-estate,rent">

Last edited by colak (2012-04-07 14:41:59)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#92 2012-04-09 10:51:30

Gallex
Member
Registered: 2006-10-08
Posts: 1,289

Re: mdn_count

plugin doesn’t support comma delimited list of sections, sadly.

but, is it possible to add sections attribute to your php code?

Offline

#93 2012-04-10 03:09:41

radneck
Plugin Author
Registered: 2005-07-03
Posts: 109

Re: mdn_count

Gallex wrote:

plugin doesn’t support comma delimited list of sections, sadly.

Actually it should – is this not working for you?

Offline

#94 2012-04-10 07:00:07

Gallex
Member
Registered: 2006-10-08
Posts: 1,289

Re: mdn_count

juhhuu! i used not the very newest (1.4) version ;)

Offline

#95 2013-08-05 17:36:00

gfdesign
Member
From: Argentina
Registered: 2009-04-20
Posts: 401

Re: mdn_count

Hi. I have a trouble with this plugin. It has left to work to me.
I want to show the number of articles of the current category, but always I get zero.
I’ve tried with:

<p><txp:mdn_count category="#" status="4" /></p> but I get <p>0</p>
<p><txp:mdn_count category="<txp:category />" status="4" /></p> but I get <p>0</p>
<p><txp:mdn_count category="<txp:category1 />" status="4" /></p> but I get <p>0</p>

However, when I specify a category by its name, I get the correct value. For example:
<p><txp:mdn_count category="fruits" status="4" /></p> I get <p>15</p>

I aim to show a message when no there loaded articles in that category, so I can’t make a conditional rule through that.
Any idea?

Offline

#96 2013-08-05 17:46:36

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

Re: mdn_count

Look out for the quotes

<p><txp:mdn_count category='<txp:category />' status="4" /></p>
<p><txp:mdn_count category='<txp:category1 />' status="4" /></p>

Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB