How to use it
- Build the replacement card as a Bricks template. Its type must be Section or Content, and it must be published.
- Select the Container, Block or Div that has the query loop.
- Under the Query control, set Alternate template every N items. With 3, the 3rd, 6th and 9th item use the template.
- In Alternate template, pick your template. The list is searchable.
How it works with your loop
- The template renders with the loop item as the current post. Dynamic data inside the template, such as the post title, reads that item.
- The swapped item replaces the normal card completely. Kiln wraps it in a
divwithdisplay: contentsthat carries the loop element'sbrxe-class and akiln-alt-itemclass. Bricks needs that class to clear old results when a filter or AJAX pagination refreshes the loop. - The count starts after your loop's offset. With an offset of 2 and N set to 3, the 3rd card you see is the first swapped one.
- The count continues across load-more pages.
- On a site with WPML, Kiln uses the translation of the template that matches the page language.
Limits
- The builder shows your normal cards. Kiln swaps the template on the front end only.
- Both fields need a value. Leave either empty and the loop renders as usual.
- A template that is not published, or is not a Section or Content template, is ignored.
- Do not use it on a loop inside a Nav element. The swapped item does not keep the list-item wrapper.
Settings
None. Turn the module on in Bricks > Kiln (it is on by default).
Requirements
Bricks 2.4 or newer.