Docs

Loop Grid

Repeat a card you design for every post of a query, in a grid with pagination, load more or infinite scroll.

On this page

The Loop Grid widget shows a list of posts (or pages, or any post type) as a grid of cards. You design the card once, as a Loop item template with dynamic data such as the post title and featured image, and the grid repeats it for every post of the query. Use it for a blog page, a portfolio, a project list or an archive template.

A grid of three blog cards, each with an illustration, the category and date, a serif title and a short excerpt
A Loop Grid showing the three latest posts with the Journal card loop item.

Before you start: design a card

The grid needs a Loop item template to repeat.

  1. Go to Urmi → Theme Builder and choose Loop items in the list of template types.
  2. Create a template and design one card with widgets such as Featured Image, Post Title, Post Info and Post Excerpt. They show the data of each post.
  3. Publish the template.

See Loop items for the details.

Add a Loop Grid

Open Insert in the left panel and find Loop Grid in the Content group, or type "loop" in the search box. Drag it onto the canvas, or click it to add it next to the selected element. See Add elements.

Then choose your card in Loop item template and set the number of Columns.

The Loop Grid settings with the Layout section showing Loop item template set to Journal card and Columns set to 3, and the Query section with Source, Post type, Items, Offset, Order by and Order
The Layout and Query sections of the Content tab.

Choose which posts to show

The Query section decides which items fill the grid. Pick a Source:

  • Custom query: choose the Post type, how many Items, the order, and optionally which items, terms or authors to include or exclude.
  • Current query (archives): shows the posts of the page being viewed. Use it in archive and search results templates, so a category archive shows that category's posts. In the editor, the latest posts are shown as a preview.
  • Related to current post: posts that share a category (or other hierarchical term) with the post being viewed. Use it under a blog post.
  • Manual selection: exactly the items you pick in Include, in that order.

Nothing found message is shown when the query returns no items.

Page through long lists

Set Pagination to show numbered links, previous and next links, a Load more button or Infinite scroll (more cards load as the visitor reaches the end). Load more and infinite scroll add cards without reloading the page.

To let visitors filter the grid by category, add a Loop Filter widget on the same page.

Mix in a different card

Alternate template shows a second Loop item template at a set Position, for example a larger, highlighted card as every third item. Turn Repeat off to use it only once, and set Column span to make it wider than the others.

Content tab settings

Content tab · Layout
SettingWhat it does
Loop item templateThe published Loop item template to repeat for every item.
ColumnsNumber of columns (1–12). Empty fits as many columns as the space allows. Can differ per device.
MasonryCards keep their own height and move up into the gaps, like a brick wall. Off by default.
Equal heightStretches the cards of a row to the tallest one. On by default. Shown when Masonry is off.
Featured image as CSS variableMakes each card's featured image available as the CSS variable var(--urmi-loop-image), for a stylesheet outside Urmi, such as your theme's, for example as a background. Off by default.
Content tab · Query
SettingWhat it does
SourceCustom query, Current query (archives), Related to current post or Manual selection.
Post typeWhich content to list, such as Posts or Pages. For custom queries.
ItemsHow many items to show (1–100). Default: 6.
OffsetSkips this many items from the start, for example to leave out a post shown above.
Order byDate, Last modified, Title, Menu order, Comments, Random or Manual order.
OrderDescending or Ascending.
Include, ExcludePick specific items to show or leave out.
Terms (taxonomy:id)Only items in these categories, tags or other terms.
AuthorsOnly items by these authors.
Ignore sticky postsTreats sticky posts like any other post instead of putting them first.
Exclude current postLeaves out the post being viewed. Useful under a blog post.
Avoid duplicatesSkips items that an earlier Loop Grid or Loop Carousel on the same page already shows.
Nothing found messageShown when there are no items.
Content tab · Alternate template
SettingWhat it does
Alternate templateAn optional second Loop item template, shown at a set position.
PositionWhich card uses it (1–100). Default: 3. Shown when an alternate template is chosen.
RepeatOn: every Nth card. Off: only the Nth card. On by default.
Column spanHow many columns the alternate card spans. Keep it at or below the number of columns. Can differ per device.
Content tab · Pagination
SettingWhat it does
PaginationNone, Numbers, Previous / next, Numbers with previous / next, Load more button or Infinite scroll. Default: None.
Previous text, Next textThe link labels. Shown for the previous / next types.
Button textThe load more label. Default: Load more. Shown for load more and infinite scroll.
Loading textShown while more cards load. Default: Loading….
Button stylePrimary, Secondary, Outline or Ghost. Default: Outline. Shown for load more.
AlignmentStart, Center or End. Can differ per device.

Design tab settings

Design tab
SectionSettings
LayoutColumn gap, Row gap, Pagination distance.
PaginationTypography, Text color and Background (with Normal, Hover and Active tabs), Border radius, Space between. Shown for numbered and previous / next pagination.
Load more buttonTypography, Text color and Background (with Normal and Hover tabs, plus Border color on hover), Border, Border radius, Padding. Shown for load more and infinite scroll.
Nothing found messageTypography, Color.

The look of each card comes from its Loop item template. Edit the template to change it everywhere the card is used.

The Design tab also has the sections every element shares: Spacing & position, Background & border and Mask. See Spacing, size & position.

Behaviour tab

The Behaviour tab has the settings every element shares. Set an Anchor ID in Anchor & classes when a page has several grids and a Loop Filter must target one of them. See Anchor, classes & attributes.

Tips

  • If you do not want to design a card, the Posts widget has a ready-made card with image, title, meta and excerpt.
  • For more on queries and archive templates, see Loop grid & carousel.