ComboStrap - Template Iterator
Table of Contents
About
iterator permits to loop and applies a template in order to create a list of pages.
You may apply the following layout:
Example
Masonry
The below iterator example:
- will generate the last 4 modified pages (defined by the page sql in the data node)
select order by date_modified desc limit 4
- laid out in a masonry layout
- with a display heading (ie heading d3)
- and the illustrative image of the page (ie page-image)
The iterator markup:
<iterator>
<data>select where is_low_quality = 0 order by date_modified desc limit 4</data>
<heading d3 text-align="center" spacing="mb-3"> The last 4 Changes </heading>
<masonry>
<template>
<card clickable>
<page-image path="$path" ratio="16:9"/>
=== $title ===
<itext color="muted"><date format="%h %d - %H:%M">$date_modified</date></itext>
$description [[$path| ]]
</card>
</template>
</masonry>
</iterator>
The Result:
The last 4 Changes
ComboStrap Styling - Text Align Attribute
May 24 - 07:35
text-align is a typographic attribute that sets the alignment of the lines of text inside a block component. Syntax where: breakpoint is optional and takes one of the breakpoint values (ie screen size) (only on Bootstrap 5) sm: small md: medium lg: large xl: extra-large the value may be:startcenterendjustifbox componenblock componentcartext componenscreen size
Pipeline
May 10 - 12:56
A pipeline is a element that contains a list of function (called a pipeline) that transforms successively a string. Pipelinetemplate Syntax where: value is the string to transform or a template variable function is one of: - make the first letter of each word a capital letter (ie uppercase letter)capitalizecutseparatorselectorx[-y]x-yheadlengthtailrconcatreplacetrim
Syntax
<iterator>
<data>select where variable = 'xxx'</data>
... header markup...
<template>$variable1 ... $variable2</template>
... footer markup...
</iterator>
where:
- If your iteration is time-based, you may need to set a page cache expiration frequency.
- If the data does not return any rows, the iterator content is not printed (ie header and footer included)