2018-12-11, 04:30

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

2013-01-28, 08:32

19 студзеня 2013 у Гродне трагічна загінуў паэт, журналіст і мой сябар (...) »

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
~ / 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, 00:00 — Size: 999,00 B