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
Creation of a top menu bar - ComboStrap Getting Started
Jan 31 - 10:11
The strap template supports the creation of a slot page called header slot in order to create a menu bar at the top location of the page. Steps Create a page called :slot_header (at the root directory of your pages) Enter the belowmenu baFavicon stepheader slomenu bamenu bar pagfooter sloUI ComponentRouting and redirectionSEO pagesubscribe
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)