Widget Templates

Customize widget HTML templates using data attributes, template variables, and the Monaco editor.

Widget Template System

Dashboard โ†’ Widgets โ†’ Templates

The template system gives you full control over how warranty options, cart items, order status displays, and shipping protection render on your storefront. Each of the 12 widget types can have a custom HTML template using Handlebars-style variables and data attributes for interactivity.

Note Custom templates require useCustomTemplate to be enabled in widget configuration. When disabled, default rendering is used.

Template Manager

Access the template manager at Dashboard โ†’ Widgets โ†’ Templates. It provides a Monaco code editor with syntax highlighting and autocompletion, a preview panel, and documentation of available variables per widget type.


Data Attributes Reference

Data attributes connect template elements to the Umbrella widget JavaScript.

AttributeDescription
data-umbrella-modal-triggerOpens a modal on click. Value: "selector" or "info".
data-umbrella-modal-close-btnCloses the modal on click.

Warranty Option Selection

AttributeDescription
data-umbrella-optionsRequired. Container for option selectors.
data-umbrella-optionRequired. Marks an individual selectable option.
data-umbrella-option-priceDisplays option price (updates on variant change).
data-umbrella-selected-stateChanges visibility based on selection state.
data-umbrella-selected-warranty-titleShows selected warranty title.
data-umbrella-selected-warranty-priceShows selected warranty price. Use "rounded" or "withCents".

Cart Actions

AttributeDescription
data-umbrella-add-to-cart-btnRequired in modals/cart. Adds selected warranty to cart.
data-umbrella-decline-btnRequired in modals/cart. Declines warranty.

Shipping Protection

AttributeDescription
data-umbrella-shipping-protection-checkboxRequired. Checkbox for enabling shipping protection.
data-umbrella-shipping-protection-checkbox-labelRequired. Label for the checkbox.

Expandable Sections

AttributeDescription
data-umbrella-expandable-sectionContainer for expandable section.
data-umbrella-expandable-contentContent that shows/hides.
data-umbrella-expandable-toggleButton that toggles content.

Accordion

AttributeDescription
data-umbrella-collapsible-accordionAccordion container.
data-umbrella-collapsible-itemIndividual accordion item.
data-umbrella-collapsible-buttonToggle button for item.
data-umbrella-collapsible-contentContent area of item.
AttributeDescription
data-umbrella-dropdown-menuDropdown container.
data-umbrella-dropdown-toggleOpens/closes dropdown.
data-umbrella-dropdown-contentDropdown content panel.
data-umbrella-dropdown-option-valueValue of each dropdown option.
data-umbrella-dropdown-selected-valueDisplays the selected value.
data-umbrella-dropdown-unselected-placeholderPlaceholder when nothing is selected.

Template Variables Reference

Variables use Handlebars syntax: {{variable}} for text, {{{variable}}} for HTML-safe content (prices).

Product

{{productImage}}, {{productName}}, {{productType}}, {{productHandle}}, {{productId}}, {{productQuantity}}, {{{productPrice}}}

Selected Variant

{{selectedVariantId}}, {{selectedVariantTitle}}, {{{selectedVariantPrice}}}

Warranty

{{warrantyId}}, {{warrantyTitle}}, {{{warrantyDescription}}}, {{warrantyImage}}, {{warrantyProductHandle}}, {{warrantyProductUrl}}

Options Loop ({{#each options}})

{{serviceLevel}}, {{term}}, {{title}}, {{{description}}}, {{imageUrl}}, {{isNoCoverageOption}}, {{{priceRounded}}}, {{{priceWithCents}}}, {{{totalPrice}}}, {{variantId}}

Selected Warranty (Cart)

{{warrantyTerm}}, {{warrantyServiceLevel}}, {{{warrantyPrice}}}, {{{warrantyPriceRounded}}}, {{warrantyTermDisplay}}, {{warrantyVariantId}}

Display Mode Flags

{{isInlineMode}}, {{isIndividualMode}}, {{isModalMode}}, {{{cheapestPrice}}}, {{{cheapestPriceRounded}}}

Line Item Context

{{isProtectedProductLineItem}}, {{isWarrantyLineItem}}

Cart Pricing

{{isMultipleQuantity}}, {{{warrantySingleLineItemPrice}}}, {{{warrantyTotalLineItemPrice}}} (plus rounded and withCents variants)

Coverage Flags

{{isEligible}}, {{coversManufacturerDefect}}, {{coversAccidentalDamage}}, {{coversWearAndTear}}, {{coversSpillOrStain}}, {{coversLostOrStolen}}

Policy (Order Status)

{{policyId}}, {{policyNumber}}, {{policyStatus}}, {{policyStartDate}}, {{policyEndDate}}, {{isActive}}, {{claimWindowOpen}}, {{daysRemaining}}, {{orderName}}, {{fileClaimUrl}}


Variables Available Per Widget Type

Widget TypeProductVariantWarrantyOptionsCoverageDisplay ModeLine ItemCartPolicy
pdp_widgetYesYesYesYesYesYesโ€”โ€”โ€”
selector_modalYesYesYesYesYesPartialโ€”โ€”โ€”
info_modalYesYesYesโ€”Yesโ€”โ€”โ€”โ€”
cart_protectedYesYesYesโ€”Yesโ€”YesYesโ€”
cart_unprotectedYesYesYesYesYesYesโ€”Yesโ€”
order_statusโ€”โ€”Yesโ€”Yesโ€”โ€”โ€”Yes
order_status_modalโ€”โ€”Yesโ€”Yesโ€”โ€”โ€”Yes
order_status_post_purchaseโ€”โ€”YesYesYesโ€”โ€”โ€”โ€”
order_status_post_purchase_modalโ€”โ€”YesYesYesโ€”โ€”โ€”โ€”
shipping_protectionโ€”โ€”Yesโ€”Yesโ€”โ€”โ€”โ€”
shipping_protection_modalโ€”โ€”Yesโ€”Yesโ€”โ€”โ€”โ€”

Tips

  • Use triple braces {{{price}}} for prices to render HTML entities correctly
  • Always include data-umbrella-options and data-umbrella-option for option selection to work
  • Test with different product variants to verify price updates
  • Use {{#if isInlineMode}} for display-mode-specific layouts
  • Include data-umbrella-modal-close-btn in modals

Book a Demo

See how myUmbrella can transform your warranty program

Choose a Time

Select a convenient time for your personalized demo

ESC

Start typing to search across all content

No results found

Try a different search term