Sections

Sections use block tags and a # prefix. Use sections to render content based on the values contained in the data reference. For example, the Guide template and the data reference provide the output displayed.

For example, a data source can contain an array of objects.

Use the # prefix in a section to iterate through the data source.

The output contains the data from the data source displayed in the specified format.

You can also use a . character with data from an array to refer to the current item in the list.

For example, consider a data source that contains an array of strings.

The template uses the # prefix to iterate through the data source. It also uses the . notation to refer to the current item.

The output lists the data from the data source.

Include a region attribute to treat the section as an impression region for reporting purposes.

If the template references an empty data source, it doesn't render any content. If the template references a function, the template passes the inner markup of the block tag to the function for processing. For all other values, the template renders the inner markup one time.

Use the ^ prefix to invert a section. This prefix is helpful when the data source contains an empty value.

For example, a data source can contain an object with no content.

Use an inverted section to display content even if the named object is empty, as shown in this example.

The output includes the content in the inverted section.