Login

Login

Advanced tags

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" />

Sample cml:hours

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)

Sample cml:hours with allowunlisted

Returned columns

cml:hours returns the following columns for each day of the week (mon, tue, wed, thu, fri, sat, sun):

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.

Sample cml:taxonomy

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 callback and return a JSONP response wrapped in the function specified by the callback parameter.

For example, if the url that serves taxonomy data is http://www.myserver.com/taxonomy, issuing a GET to http://www.myserver.com/taxonomy?callback=myCallback should 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 q and callback and provides taxonomy search results for the query specified by the q parameter as JSONP wrapped in the function specified by the callback parameter. 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 to http://www.myserver.com/taxonomy_search?callback=myCallback&q=dogs should 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.

Products

read more...

Customers

read more...

Social Media



Law Talk

Privacy Policy Terms of Service ©2011 CrowdFlower