<![CDATA[ Pluralize - My Forums]]> https://forums.modx.com/thread/?thread=103691 <![CDATA[Pluralize]]> https://forums.modx.com/thread/103691/pluralize#dis-post-557743
<?php
return  $count > 1?  's' : "";

On the template I use pdoPage to grab all the resources created by a specific user:
[[!pdoPage@pdoPagination?
    &elementClass=`modSnippet`
    &element=`pdoResources`
    &parents=`0`
    &resources=`-1`
    &where=`{"createdby:=":[[!getUrlParam? &name=`author` &int=`1`]]}`
    &tpl=`authorFilter.html`
    &hideContainers=`1`
    &showHidden=`0`
    &toPlaceholder=`results`
    &totalVar=`total`
    &sortby=`{"publishedon":"DESC"}`
    &sortAlias=`1`
    &limit=`6`
    &pageLimit=`5`
    &pageNavVar=`page.nav`
    &totalVar=`page.total`
]]

Then this to display a message:
[[!Profile?
    &user=`[[+createdby]]` &useExtended=`1`
]]
[[+member]] has [[!+page.total]] articles[[!pluralFilter? &count=`[[+total]]`]].


I've compared the problem page with other working pages and don't see any reason why this one page is failing to pluralize.]]>
todd.b Mar 31, 2018, 10:22 PM https://forums.modx.com/thread/103691/pluralize#dis-post-557743
<![CDATA[Re: Pluralize (Best Answer)]]> https://forums.modx.com/thread/103691/pluralize#dis-post-557792
Moving the pdoPage call before checking for page.total was the fix.

Thanks @BobRay for the suggestions.]]>
todd.b Apr 04, 2018, 09:04 PM https://forums.modx.com/thread/103691/pluralize#dis-post-557792
<![CDATA[Re: Pluralize]]> https://forums.modx.com/thread/103691/pluralize#dis-post-557746
Does the createdby field of the resource hold the ID of the user?]]>
BobRay Apr 01, 2018, 04:11 AM https://forums.modx.com/thread/103691/pluralize#dis-post-557746
<![CDATA[Re: Pluralize]]> https://forums.modx.com/thread/103691/pluralize#dis-post-557745
I already tried
&count=`[[+page.total]]

but no change.

Got rid of the uncached placeholder.]]>
todd.b Mar 31, 2018, 11:24 PM https://forums.modx.com/thread/103691/pluralize#dis-post-557745
<![CDATA[Re: Pluralize]]> https://forums.modx.com/thread/103691/pluralize#dis-post-557744
Also, you shouldn't need to call the page.total placeholder uncached, since it's being set by the Profile snippet (right?), which is uncached.

FWIW, being lazy I tend to just use: article(s). wink]]>
BobRay Mar 31, 2018, 10:50 PM https://forums.modx.com/thread/103691/pluralize#dis-post-557744