<data:postrepeater>
AJAX
Data
ATTRIBUTES
EXAMPLES
Forms
Layout
Logic
Navigation
Personalisation
Standard
Templates
Regions
Third Party

<data:postrepeater> </...>

Repeats a Post template to show Posts in the specified Post Category.

Used in place of a <data:repeater>, to provide administrators with an improved page editing experience, by allowing the control attributes to be changed via options presented in the page editor left panel.

To edit the default template used to render Posts:
  • Navigate to Dashboard > Website > Designs
  • Click 'Dynamic Displays' located underneath a website design, followed by 'Posts List'

Attributes

dataFilter
array
A Filter Array which will be used to filter results from the datasource.
dataJoins
array
Data Joins

Array of tables to join with, if datasource is a function that supports a Query Array.
dataLimit
int
Data Limit defines the Maximum number of rows to be displayed.
This value is superceeded by paging and pagingrows
dataOrder
array
Data Order
dataSearch
string
Filter results to match those found by this search query.

Typically used with a <forms:searchbox id="searchbox" /> in an ajax:region.
Eg: datasearch="[? $searchbox.getValue() ?]"
dataStart
int
The number of results to skip
id
string
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') ?]).
paging
bool
Whether to enable paging for this control. With paging enabled, the initial number of results will be limited to the value of pagingrows, and a 'Show More' button will appear.
Each click of the button will append pagingrows more rows. Default = false.
pagingRows
int
Use in conjunction with paging, to control the initial number of rows to be shown, and the number of rows loaded when 'Show More' is clicked. Default = 10.
postCategory
string
Integer or comma separated list of integers representing the Post Category ID/s.
templateRegionsShown
string|null
Template Regions Shown

Each template type defines 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.

Regions defined for each templateType:
email
No template regions defined for email template type.
list
icon date shortcontent
templateType
string
(Required) The template type.

Possible Template Types: email list
variant
string
Template display variant

Variants defined for each templateType:
email
linear
list
bigpic boxy card classic column featured gallant linear overlay portrait relative split tiny wide wrap

Examples

Display All Posts

HTML:

<data:postrepeater paging="true" pagingrows="10" templatetype="list" variant="card" />

DataStart and DataLimit Attributes

Allows you to show from a record, to a record. Behaves like the LIMIT clause in SQL.

HTML:

<h1>Show the First Three Posts</h1> <data:postrepeater templatetype="list" variant="card" datalimit="3" /> <h1>Show the Second and Third Post</h1> <data:postrepeater templatetype="list" variant="card" datastart="1" datalimit="2" /> <br /><br /> datastart="1" datalimit="2" behaves the same as SQL's LIMIT 1 2

DataFilter Attribute

Allows you to specify conditions in your query. Behaves like the WHERE clause in SQL.

HTML:

<h1>Filter posts by date</h1> <data:postrepeater templatetype="list" variant="card" datafilter="[? [['post_date', '&gt;', date('Y-m-d H:i:s', strtotime('-24 hours'))]] ?]" />

DataOrder Attribute

Allows you to specify conditions in your query. Behaves like the ORDER clause in SQL.

HTML:

<h1>Change the order posts are displayed</h1> <data:postrepeater templatetype="list" variant="card" datafilter="[? [['post_date', '&gt;', date('Y-m-d H:i:s', strtotime('-24 hours'))]] ?]" dataorder="[? [['post_date', 'asc']] ?]" />