Arlo home

Field Helpers

Field helpers are shared functions available inside Web Controls templates. Use them to format data returned by the Arlo API without writing additional JavaScript.

Using Field Helpers

Call a helper inside an Underscore template with <%= ... %>. The fields available to a template depend on its control; refer to the relevant module page for its data fields.

<span class="event-date"><%= formatDate(StartDateTime, "D MMM YYYY") %></span>
            

Helper Reference

Helper & Example Description
arloDebug()

Example:
<%=
arloDebug()
%>
Logs all non-function properties in the current template data object to the browser console. It renders no output.
formatDate(date, format)

Example:
<%=
formatDate(StartDateTime, "ddd D MMM")
%>
Formats a date using Moment.js format tokens.
formatCollection(collection, format, showLinks)

Example:
<%=
formatCollection(Presenters, "ul", true)
%>
Formats an array as comma-separated text (csv) or an unordered list (ul). Set showLinks to true when items with a ViewUri should be rendered as links.
formatAdvertisedOffers(config)

Example:
<%=
formatAdvertisedOffers({
  freeText: "Free",
  showSingleOffer: true }
)
%>
Formats advertised or best advertised offers. Configuration includes freeText, showPriceWithTaxInclusive, showSingleOffer, showLabel, showCurrencyCode, showMessage, showTaxRate, and includeDiscountOffers.
formatRegistrationInfo(format)

Example:
<%=
formatRegistrationInfo("link")
%>
Renders an event registration action using the event's registration information. Use button, link, or message.
formatSessionsInformation(config)

Example:
<%=
formatSessionsInformation({
  fieldsToDisplay: ["Name", "Date"] }
)
%>
Renders session information for a multi-session event. Configure fieldsToDisplay, advertisedOffersConfig, template, or targetElement.
contentField(name)

Example:
<%=
contentField("Prerequisites")
%>
Returns the text for a named event-template content field.
formatEventTemplateCategoryBreadcrumbs(categories)

Example:
<%=
formatEventTemplateCategoryBreadcrumbs(CategoryPaths)
%>
Renders the first category path as an ordered breadcrumb list.
createMap(config)

Example:
<%=
createMap({
  width: 200,
  height: 200,
  zoom: 16,
  type: "static"
})
%>
Creates a Google map from Location or GeoData. The application must be configured with googleMapsAPIKey. Configure width, height, zoom, and map type: static, dynamic, or embed.

Accessibility

Use the HTML generated by helpers within semantic template markup. Provide descriptive link text, preserve heading order, and do not rely on generated content alone to communicate essential information.