Ditto Request Extender

With &extenders=`request` you can set parameters of a Ditto call from a URL (GET variables) or input to a form (POST variables). You can also achieve this using a config file, but the extender provides more control and security.

The name of each parameter must be prefixed by ditto_ , e.g. www.example.com?ditto_display=10&ditto_tpl=myTemplate. If you have several Ditto calls on a page, and have used &dittoID to distinguish them, the ID and another underscore must be added to the prefix.

Not every parameter can be set. The "banned" list is itself a parameter called &bad, which defaults to &seeThroughtUnpub, &showInMenuOnly, &showPublishedOnly, &debug, &start, &config, &extenders and &dittoID. Parameters may not contain certain "dangerous" characters, including the percent sign, so you cannot set &dateFormat using the extender (you could do it via templates if required). &orderBy needs to be a complex array by the time the extender sees it, so in practice it cannot be set via the URL. &sortBy and &sortDir are still available if necessary.

Permitted parameters can be restricted to a list in the &good parameter. The default is empty, so anything not "bad" is allowed.

HTML tags are excluded from the input unless you set &stripTags=`0`. For testing, you can add &dbg=1 to the URL to obtain a "sanitized" list of input values, displayed above the output list.


Request extender examples using URLs:

using ditto.title.date template

(href="request-example.html?ditto_tpl=ditto.title.date")

using ditto.title.date template plus striping

(href="request-example.html?ditto_tpl=ditto.title.date&ditto_tplAlt=ditto.title.date.other")

ordered by pkDate template variable (ascending)

(href="request-example.html?ditto_sortBy=pkDate&ditto_sortDir=ASC")

Setting different parent folder

(href="request-example.html?ditto_parents=6&ditto_display=3)