Menu
All plugins

Property Gallery for Bricks

A Bricks element that shows a set of photos as a tidy 3:2 grid, a large-plus-two top gallery, or a single image, and opens a full-screen viewer with a thumbnail rail. Photos come from the Media Library or an ACF Gallery field.

Version: 1.1.10 · Requires: Bricks 1.9+, WordPress 6.2+, PHP 7.4+ · See the live demo

Installation

  1. Upload and activate the plugin. Bricks must be active.
  2. Add the Property Gallery element from the Media category.
  3. Choose the images, then pick a presentation.

Settings

  • Presentation (default: Photo grid). Other choices: Top gallery (large + two), Top gallery (large + three) and Single image.
  • Image source (default: Media Library selection). The other choice is ACF Gallery field.
  • Images (drag to order). Shown for the Media Library source. The order you set is the order in the viewer.
  • ACF Gallery field name or key. Shown for the ACF source. The field must be a Gallery field on the current post or the current Bricks loop item.
  • Image to show (1-based position) (default: 1). Single image only.
  • Accessible gallery label (default: Property photos). Read out by screen readers and used as the viewer name.
  • Photos shown before the more tile (default: 8). Choose 4, 8 or 12. Photo grid only.
  • More tile layout (default: Full row). The other choice is Single tile, one tile the same size as a photo. Photo grid only.
  • Show image captions in viewer (default: Off). Uses the caption from the Media Library.
  • Grid spacing (Style tab, default: 12px) and Image corner radius (Style tab, default: 8px).

Quick start

  1. Add the element and select 10 or more photos in the Images control.
  2. Leave Presentation on Photo grid. Eight photos show, with a +N tile for the rest.
  3. View the page and click any photo. The viewer opens at that photo.
  4. Change Presentation to Top gallery to get one large photo beside two smaller ones, with a photo count button.

How it works

Presentations

  • Photo grid: four columns (two on narrow screens) of 3:2 tiles. If there are more photos than the preview count, a separate +N tile opens the viewer at the first photo not shown.
  • Top gallery (large + three): a large photo beside three stacked photos, with the total photo count shown as a badge on the last tile. Any tile opens the viewer at that photo. With fewer than four photos the layout adapts, and on phones the three smaller photos sit in a row under the large one.
  • Top gallery: a large photo beside two smaller ones, with a count button showing the total number of photos (for example 14) in the corner. It does not scroll. With one or two photos the layout adapts. On phones the large photo is full width with the others below.
  • Single image: the photo at the position you chose. Clicking it opens the full viewer at that same photo.

The viewer

The viewer shows the photo uncropped, with previous and next buttons, a count, and a scrollable two-column thumbnail rail. Hide collapses the rail and Show thumbnails brings it back. On narrow screens the rail becomes a horizontal strip across the top. While it is open the page behind does not scroll, and the viewer is moved to the end of the page so a parent section cannot clip it.

Keyboard and screen readers

The viewer is a labelled modal dialog. Focus moves into it when it opens and returns to the photo you clicked when it closes. Tab stays inside the viewer. Escape closes it and the left and right arrow keys change photo. The current position is announced as the photo changes.

Images and aspect ratio

The gallery is designed for 3:2 landscape photos. Tiles are always 3:2 and a photo with another shape is cropped to fit, so supply 3:2 photos. The viewer shows each photo whole. Tiles use the medium-large size (the large photo in Top gallery uses the large size) and the viewer loads the original full-size photo. Alternative text comes from the Media Library. Leave it empty for purely decorative photos.

ACF Gallery fields

Choose ACF Gallery field as the source and enter the field name or key. The plugin accepts the ID, image array and image URL return formats. A URL must belong to a photo in the Media Library. In a query loop the field is read from the current loop item.

Building a listing layout

Use two Property Gallery elements: a Top gallery at the top and a Photo grid with More tile layout set to Single tile as a thumbnail strip. Add the Sticky Bars element for a booking bar that follows the visitor, and Key Facts List for the summary row. The demo page shows the whole layout.

Tips

  • Crop or export photos at 3:2 before uploading, so nothing important is cut off in the tiles.
  • Write alternative text in the Media Library. Tile buttons and viewer thumbnails use it for their accessible names.
  • Use a descriptive gallery label when a page has several galleries, such as Trip photos and Thumbnails.

Troubleshooting

  • The element is empty: no usable photos were found. In the builder it shows a hint. On the page it prints nothing. Check that the images are in the Media Library.
  • Nothing shows with ACF: check that ACF is active, the field is a Gallery field, and it belongs to the current post or loop item. Photos that are not in the Media Library are not supported.
  • Spacing or radius does not change: set them in the Style tab. Both take a unit such as px.
  • Old styles after an update: purge your page cache so the new stylesheet version is requested.
  • Tiles look cropped: expected for photos that are not 3:2.

For developers

  • The element name is nlpg-property-gallery. Wrapper classes are nlpg-gallery plus nlpg-gallery--grid, --top or --single, and nlpg-gallery--more-tile for the single more tile.
  • The photo list is printed as JSON in the data-nlpg-gallery attribute. Galleries added later start on the bricks/ajax/popup/loaded event.

Known limits

  • Photos that are not Media Library attachments are not supported.
  • The photo list is carried as JSON in the page and the viewer, including its thumbnails, is built only when it first opens, so the page stays light; very large galleries still add their JSON to the HTML.
  • Captions show in the viewer only, never on the tiles.