Template Processor

All queries in feed v4 support user defined template strings.

Template strings can be set using query parameters. To specific a template, list one or more template names in the templates[] query parameter.

Single template example query string: ?templates[]=title

Multiple template example query string: ?templates[]=title&templates[]=body

To specify the actual template string, use the name of the template as a query parameter with its value being the full template string.

Example template string: <tr><td{@masterRoutelongName}</td><td>{@direction}</td><td>{@status}</td></tr>

To use this as the 'body' template, you would use the following query string: ?templates[]=body&body=%3Ctr%3E%3Ctd%7B%40masterRoutelongName%7D%3C%2Ftd%3E%3Ctd%3E%7B%40direction%7D%3C%2Ftd%3E%3Ctd%3E%7B%40status%7D%3C%2Ftd%3E%3C%2Ftr%3E

Note that the template string has been URL encoded per RFC 1738.

The valid variable names for use in a template string are based on the object fields for each query's object type.

The processed template value will be added to each object returned in the data array, in a map called 'templates' using the template name as the key name.