ajax:delayedload ajax:event ajax:navigation ajax:region
data:calendar data:column data:eventrepeater data:postrepeater data:productbrandrepeater data:productcategoryrepeater data:productrepeater data:repeater data:table data:template
forms:address forms:captcha forms:checkbox forms:checkboxgroup forms:codeeditor forms:combobox forms:datepicker forms:dialogbox forms:editbox forms:fileupload forms:form forms:hidden forms:money forms:officeuseregion forms:option forms:password forms:paymentmethod forms:radiobutton forms:radiobuttongroup forms:row forms:searchbox forms:signature forms:slider forms:spinbox forms:submitbutton forms:submitimage forms:submitlink forms:successcontent forms:textarea forms:timepicker
layout:gallery layout:productgallery layout:rotator layout:stepper layout:stepperpanel layout:tablist layout:tablistitem
logic:dependency logic:else logic:if logic:include logic:parse logic:variable
navigation:breadcrumbs navigation:item navigation:primary navigation:secondary
personalisation:firstname personalisation:fullname personalisation:lastname personalisation:other
standard:audio standard:embed standard:icon standard:image standard:link standard:script standard:tooltip standard:video
templates:button templates:card templates:column templates:fancybox templates:faq templates:flexlayout templates:header templates:row templates:section templates:styles templates:teammember templates:testimonial
regions:content regions:contentadditional regions:security regions:togglable
Third Party
thirdparty:googlemap thirdparty:googlemapmarker

<data:template />

Oncord comes with templates for displaying different types of component data such as those used to display a group of Posts as list or grid, or to view individual details of a product. These templates can be set per Design on your site, and are edited under 'Dynamic Displays' in the Designs dashboard.

This control allows you to select a component, a template type and a template variant, and it will render the appropriate template.

Most commonly, this is used with a DataRepeater, to iterate over a DataSource.


(Required) Component

The Oncord Component which describes the data you would like to display using a template.

Possible Components:
Give this control a unique id. Can be accessed in the client DOM (eg, document.getElementById('myid') or in the server DOM using [? $myid ?] or [? $('myid') ?]).
Template Regions Shown

Template types define a number of available regions which can be shown or hidden within a template.

Templates are populated with a $templateRegionsShown array which contains a key for each defined region, and a value representing whether that region should be shown.

The template may then use logic to show or hide regions based on the values in this array.

When the TemplateRegionsShown attribute is specified, it accepts a comma-separated list of region names. These regions will have their $templateRegionsShown['region_name'] value set to true, and all other region values will be set to false.

If this attribute is omitted, all regions $templateRegionsShown value will be set to true.

An empty string will be treated as if no regions were specified, so all $templateRegionsShown values will be set to false.
(Required) Template Type

Components which have templates may have a number of Template Types, depending on what the templates are intended for. The template types available will depend on the Component you choose.

When component="\Components\Commerce\Products"
Possible Template Types: details list
When component="\Components\Commerce\Products\Brands"
Possible Template Types: details list
When component="\Components\Commerce\Products\Categories"
Possible Template Types: details list
When component="\Components\Marketing\Events"
Possible Template Types: list
When component="\Components\Website\Comments"
Possible Template Types: list
When component="\Components\Website\Posts"
Possible Template Types: email list
When component="\Components\Website\Posts\Categories"
Possible Template Types: email

For a given Component and Template Type, there are a number of template variations which offer different visual presentations of the same data.

Each templateType for a given Component has a default variant which will be used if this attribute is left unspecified.

The default variant for the Component and TemplateType will be used if a specific variant is not provided. You can set the default variant per Design from the Designs Dashboard under 'Dynamic Displays'.

When component="\Components\Commerce\Products" templateType="details"
Possible Variants: classic minimal original sidebar
When component="\Components\Commerce\Products" templateType="list"
Possible Variants: card classic round square table
When component="\Components\Commerce\Products\Brands" templateType="details"
Possible Variants: classic stoic
When component="\Components\Commerce\Products\Brands" templateType="list"
Possible Variants: classic
When component="\Components\Commerce\Products\Categories" templateType="details"
Possible Variants: classic stoic
When component="\Components\Commerce\Products\Categories" templateType="list"
Possible Variants: classic descriptive
When component="\Components\Marketing\Events" templateType="list"
Possible Variants: card wide
When component="\Components\Website\Comments" templateType="list"
Possible Variants: speech
When component="\Components\Website\Posts" templateType="email"
Possible Variants: linear
When component="\Components\Website\Posts" templateType="list"
Possible Variants: bigpic card classic column featured gallant linear overlay portrait relative split tiny wide wrap
When component="\Components\Website\Posts\Categories" templateType="email"
Possible Variants: headings


Repeating a Post Template

Here, a Data Repeater is used to create a list of Posts using a Post List template.


<data:repeater id="posts_repeater" datasource="\Components\Website\Posts::getAll()" as="post" > <data:template component="\Components\Website\Posts" templateType="list" variant="overlay" /> </data:repeater>

Repeating a Product Template

Here, a Data Repeater is used to create a list of Products using a Product List template.


<data:repeater id="products_repeater" datasource="\Components\Commerce\Products::getAll()" as="product" > <data:template component="\Components\Commerce\Products" templateType="list" variant="card" /> </data:repeater>