Analytics & Reports
Analytics

Template

The container for displaying a template set up in Command Center

Provided Aliases: $template

Example

<gb-template target="my-template"></gb-template>

Properties

Property Type Default Required Notes
target string Yes The name of the template from Command Center to render when it appears in the Search results object.

State

Property Type Default Notes
isActive boolean false true when the template is in the current result set, false otherwise.
rule string null The rule associated with the template in Command Center.
zones { string: Store.Zone } An object of zone names mapped to zones.

Events

Event Affected State Properties
'template_updated' zones

Child Components

The child component contained within the gb-template is determined by the zone. It can be any one of the the following:

Child Components: Rich Content Zone

A rich content zone associated with the template in command center. It renders using a gb-raw tag.

Example

const zone = {
  content: 'inner content';
}
<gb-rich-content-zone zone="{ zone }"></gb-rich-content-zone>

Properties

Property Type Default Required Notes
zone { string: RichContentZone } Yes A zone object that requires a content property.

State

This component does not have any properties in state.

Events

This component does not listen for any events.

Child Components: Products Zone

A products zone associated with the template in command center. It renders a list of gb-product tags.

Example

const zone = {
  products: [{
    title: 'tomatoes',
    price: 5,
    id: 1324
  }, {
    title: 'cucumbers',
    price: 4,
    id: 3124
  }];
}
<gb-products-zone zone="{ zone }"></gb-products-zone>

Properties

Property Type Default Required Notes
zone { string: ProductsZone } Yes A zone object that requires a products property.

State

This component does not have any properties in state.

Events

This component does not listen for any events.

Child Components: Content Zone

A content zone associated with the template in command center.

Example

const zone = {
  content: 'inner content';
}
<gb-content-zone zone="{ zone }"></gb-content-zone>

Properties

Property Type Default Required Notes
zone { string: ContentZone } Yes A zone object that requires a content property.

State

This component does not have any properties in state.

Events

This component does not listen for any events.