Blog Sections Open

Paginating a Gallery Built from Multi-Value TV Data

A guide to thinking about pagination when the gallery source is a multi-value TV or ddGetMultipleField output rather than a normal document list.

Pagination is easy when the source is a normal resource query. It gets more interesting when the gallery is built from a multi-value TV field or helper output such as ddGetMultipleField.

Why pagination does not appear automatically

If the gallery HTML is already generated from one big string, there is no native item-by-item query for the paginator to work with. The page knows the final markup, not the underlying collection in a queryable form.

What this means architecturally

  • pagination works best on structured arrays or query results
  • pre-rendered chunks of gallery HTML are much harder to paginate cleanly
  • the earlier you structure the image list, the easier paging becomes

Recommended approach

If gallery size matters, treat the image set as a collection first and the markup as the last step. That often means transforming the TV data into rows that can be sliced or queried before rendering.

In short: paginate data, not finished HTML.

Newer post

Showing MultiTV Data from Multiple Resources in DocLister

A practical pattern for collecting MultiTV data from several resources and preparing it for DocLister output instead of expecting raw MultiTV values to aggregate automatically.

Older post

Adding Custom Controllers to an Evolution 2 Project

How to move page logic out of Blade views in an Evolution 2 project by registering a custom TemplateProcessor and mapping template aliases to controller classes.