Advanced tags
- cml:hidden- Hidden form field
- cml:hours - Advanced hours of operation input tool
- cml:search - Inline search field that submits a URL
- cml:taxonomy - Advanced tree search and input tool
cml:hidden
Renders a hidden form input. Accepts all basic tag common attributes.
<cml:hidden name="secret_sauce" value="true" />
This is best used for submitting additional hidden information, such as the worker’s browser information with the user_agent validator:
<cml:hidden label="workers_browser" validates="user_agent" />
cml:hours
Renders a widget for allowing input of hours of operation for every day of the week. Accepts all basic tag common attributes except for value and default.
<cml:hours label="When is this business open?" allowunlisted="true" />

Note that cml:hours is always required. If you do not want the field to be required, use CML Logic to hide the field if the worker does not need to input anything.
Additional attributes
- allowunlisted
-
If set to “true”, the hours dropdowns will include a “Not listed” option that will allow workers to specify that the hours of operation were not listed for that given day. Defaults to “false”. (optional)

Returned columns
cml:hours returns the following columns for each day of the week (mon, tue, wed, thu, fri, sat, sun):
-
{field_name}_{day}_openallday- "TRUE" if the worker selected "Open all day", "FALSE" otherwise. -
{field_name}_{day}_closedallday- "TRUE" if the worker selected "Closed all day", "FALSE" otherwise. -
{field_name}_{day}_open_1- The first open time. One of several values:- "" - Nothing is submitted if the worker chose "Open all day" or "Closed all day"
- "not_listed" - If "allowunlisted" is set to "true", workers will have the option of selecting this option if they can not, for example, find that specific opening time on a business' website.
- "##:##" - Otherwise, a time is submitted in 24-hour format. For example: "17:30" (5:30pm)
-
{field_name}_{day}_close_1- The first close time. Same format as `open_1` -
{field_name}_{day}_open_2- The second open time, if the worker clicked "Add extra time range". Same format as `open_1` -
{field_name}_{day}_close_2- The second close time, if the worker clicked "Add extra time range". Same format as `open_1`
cml:taxonomy
Renders a widget that allows workers to search and browse through a hierarchical list of items (a taxonomy) and select an item to be submitted. Taxonomy data must be formatted according to the Taxonomy Data Format section below.

Additional Attributes
- src
-
The taxonomy datasource; can be either a url or the name of a javascript variable defined in the custom javascript portion of the cml editor. Urls must accept the parameter
callbackand return a JSONP response wrapped in the function specified by thecallbackparameter. -
For example, if the url that serves taxonomy data is
http://www.myserver.com/taxonomy, issuing a GET tohttp://www.myserver.com/taxonomy?callback=myCallbackshould return the JSONP response myCallback( ...my taxonomy data... )- root-select
-
If set to
"true", the taxonomy tool to only allow workers to select top-level items, while still being able to search and browse the full taxonomy. Useful when only a general category is desired. - selectable
-
Add taxonomy items as selectable in the tool (normally only taxonomy endpoints are selectable). Accepts a comma separated-list of taxonomy item ids, e.g.
"1,2,3,4" - nonselectable
-
A comma separated list of taxonomy items to remove as selectable in the tool.
- top-level
-
A comma-separated list of taxonomy ids to show as top-level items in the widget. Overrides the topLevel items set in the taxonomy JSON.
- search-src
-
A url that accepts the parameters
qandcallbackand provides taxonomy search results for the query specified by theqparameter as JSONP wrapped in the function specified by thecallbackparameter. When this attribute is provided, a search box will be rendered below the taxonomy tool, allowing the worker to search through the taxonomy. -
For example, if the search url is
http://www.myserver.com/taxonomy_search, issuing a GET tohttp://www.myserver.com/taxonomy_search?callback=myCallback&q=dogsshould return a JSONP response like: myCallback( [ {'name': "Pet Supplies > Dog Dishes", "id": "1234"}, {'name': "Books > Doggies", "id": "5678"} ] )-
Search results should be an array of javascript objects (as shown above) with the following attributes:
name (String, required):The name of the taxonomy item to display when search results are rendered.id (String, required):The taxonomy item id of the search result.
- log-search
-
If set to
"true", a field containing a comma-separated list of search queries will be returned with the worker’s judgment. Useful to tune search results. Ignored unless search-src is set.
Taxonomy Data Format
Taxonomy data should be in the JSON format shown below. Each taxnomy item should be associated with a category id.
{
'topLevel': [1,2],
'taxonomyItems': {
'1': {
'title': 'Books',
'summary': 'Stuff you\'d find in a library',
'children': ['3','4']
},
'2': {
'title': 'Shoes',
'summary': 'Stuff you\'d find in a shoebox',
'children': ['5','6']
},
'3': {
'title': 'Good books',
'summary': 'Books you want to read, not {$4}',
'parent': '1'
},
'4': {
'title': 'Bad books',
'summary': 'Books that suck',
'parent': '1'
},
'5': {
'title': 'Women\'s shoes',
'summary': 'Shoes for dudettes',
'parent': '2'
},
'6': {
'title': 'Men\'s shoes',
'summary': 'Shoes for dudes',
'parent': '2'
}
}
}
- topLevel
- An array of root-level item ids for your taxonomy. The items with these ids will be the first ones shown the the worker when they see the taxonomy tool.
- taxonomyItems
- A javascript object containing the actual taxonomy items, keyed by item id. Each taxonomy item can have the following attribtues:
title (String, required):The name of the taxonomy item that will show up in the tool.summary (String, optional):A brief description of the taxonomy item. Links to other items can be included by enclosing the item id preceeded by a dollar sign in curly braces, e.g.{$4}parent (String, required):The item id of the item's parent. Required on items that are children of other items.children (Array, required):An array of taxonomy ids of the item's children. Required on items that are parents of other items.related (Array, optional):An array of taxonomy ids of items related to this item. Related items will be listed beneath the item description in the taxonomy tool.