Example file for basing new Extenders on
| Example | Example file for basing new Extenders on |
| Parameters | Define any parameters needed in the extender or to override Ditto defaults |
| param | The purpose of your parameter goes here |
| Placeholders | Defin the values of custom placeholders for access in the tpl like so [+phname+] |
| $placeholders[‘example’] | Add the placeholder example to the custom placeholders list with the source pagetitle in both display and backend using the exampleFunction callback and pagetitle as the field for QuickEdit. |
| exampleFunction | Takes the resource array for an individual document and returns the value of the placeholder, in this case the uppercase version of the pagetitle |
| Filters | Define custom or basic filters within the extender to expand Ditto’s filtering capabilities |
| $filters[“custom”][“exampleFilter”] | Add the filter exampleFilter to the custom filters list with the source pagetitle and the callback exampleFilter |
| exampleFilter | Takes the resource array for an individual document and asks for the return of a 0 or 1 with 1 removing the document and 0 leaving it in the result set. |
| $filters[“parsed”][] | Add the pre-parsed filter to the parsed filters list with the source as id, the value of 9239423942 and the mode 2 |
The purpose of your parameter goes here
Any options that your parameter can have go here
”default”
Add the placeholder example to the custom placeholders list with the source pagetitle in both display and backend using the exampleFunction callback and pagetitle as the field for QuickEdit. If you only needed the placeholder in the frontent you would just use “pagetitle” as the first value of the array. If the callback was in a class use the array($initialized_class,”member”) method.
function exampleFunction( $resource )
Takes the resource array for an individual document and returns the value of the placeholder, in this case the uppercase version of the pagetitle
Add the filter exampleFilter to the custom filters list with the source pagetitle and the callback exampleFilter
function exampleFilter( $resource )
Takes the resource array for an individual document and asks for the return of a 0 or 1 with 1 removing the document and 0 leaving it in the result set. In this case, if the lower case value of the pagetitle is foo, it is removed while all other documents are shown
Takes the resource array for an individual document and returns the value of the placeholder, in this case the uppercase version of the pagetitle
function exampleFunction( $resource )
Takes the resource array for an individual document and asks for the return of a 0 or 1 with 1 removing the document and 0 leaving it in the result set.
function exampleFilter( $resource )