2012-05-19, 08:57

Feb 27, 2012 — Notify Users module, ver. 0.5 released — user can choose between sending single message (...) »

2009-11-03, 08:40

On November 1, 2009, I bought and configured an additional domain for all web services (...) »

2009-10-14, 07:19

The site Litaratura.org is devoted to Belarusian literary works and translations. (...) »

2009-01-12, 20:46

Late November 2008 marked the 20th anniversary of the official founding of the Belarusian (...) »

Registered User Area Log into This Site
Show Credits... Credits
Show Donation/ Payment Page... Donate/ Pay
Worthwhile Services
Refresh My Local Time (GMT+1)... 2012-05-19, 08:57
  • Ukraine (1)
    United States (6)
  • Today (148)
  • Yesterday (386)
~ / Public Domain Software / Extensions to Ditto / countDocs Extender $_
countDocs Extender
Click To View A Full Size Image...
2010-01-10, 18:45

Ditto’s extender is an opportunity for defining custom placeholders and/ or filters without interfering into snippet’s core code.

Particularly, a custom filter is an interesting thing — it is a callback function that the core code executes on each item in the final dataset.

countDocs extender counts returned documents and sets placeholder with the calculated value.

How to use countDocs

# 1) put countDocs.extender.inc.php file into /assets/snippets/ditto/extenders folder
# 2) call your Ditto as:
[[Ditto? &parents=`3,4,5` &display=`1` ... &extenders=`countDocs` &tpl=`@CODE:[+count+]` ... ]]

In the above example, Ditto counts documents within 3, 4, and 5 containers. Please notice the display parameter set to 1 — placeholders are being attached to each document within the returned dataset while we (most likely) need to obtain this value in one copy.

Download This Attachment... countDocs Extender — the very latest version
Last modified: 2010-01-11, 09:15 — Size: 999,00 B — Users: 72 — Downloads: 103
Click to show a form...Click to hide the form... Write a comment
  • Required fields are marked with *.
  • Comments are published after the approval of the site moderator, who is a human rather than a wind-fast computer program so please be patient. Off-topic comments are definitely removed.

* Code:
 
Enter this code into the appropriate field of the form while submitting an e-mail or a comment. If you have trouble with reading it, generate another...
Zaigham
Comment
Thanks.
Comment #1 on: 2010-02-01, 15:17
nice extender. :)
mark
Comment
PHX and countDocs extender
Comment #2 on: 2011-08-03, 18:49
Hi, first of all, great work on this extender.

Ive been using the extender on one of my sites and have recently started using the PHX plugin.

I noticed that when the PHX plugin is active your extender doesnt work.

All I get is: "&tpl either does not contain any placeholders or is an invalid chunk name, code block, or filename. Please check it."

Any chance of help on with this ?

Cheers

Mark
Aleksander Maksymiuk
Comment
Re: PHX and countDocs extender
Comment #3 on: 2012-01-25, 21:09
Sorry for huge delay with this response (due to some implementations/experiments on this site I have accidentally turned off notifications on new comments so I noticed your question only today while reviewing database :(

Standalone PHx plugin (that you have started to use) conflicts with Ditto snippet that comes with its own implementation of PHx. I don't remember the essence of this conflict, but this issue has been discussed on MODx forum from time to time.