Blog Sections Open

Wrapping Every Three DocLister Items in a Custom Container

A layout technique for grouping DocLister output into repeated wrappers by using the iteration counter intelligently.

Sometimes a flat item loop is not enough. You may need DocLister to group every three items into a dedicated wrapper so the final markup matches a slider, a card row, or a custom grid container.

The useful placeholder

DocLister exposes an iteration counter, often through [+iteration+]. That lets you react to item position while keeping the query logic untouched.

The layout idea

  • open a wrapper when the iteration starts a new group
  • render items normally inside the group
  • close the wrapper when the group reaches the desired size

Why this is preferable

You keep the grouping rule in the view layer instead of trying to split the query into several manual blocks. That is easier to maintain when item counts change.

When to use it

  • three-column promotional blocks
  • manual slide grouping
  • catalog rows with strict layout wrappers
  • special marketing sections that need repeated container markup

When the design asks for grouped output, iteration-aware wrappers are usually the cleanest DocLister answer.

Newer post

Filtering DocLister Results by a TV-Based Section Map

A cleaner way to build DocLister selections when resources point to sections through a TV instead of using deeply nested inline DocLister calls.

Older post

Creating Custom TVs in Evolution CMS

How to combine multiple form controls into one custom TV in Evolution CMS and store the result as a structured value.