Image Attachment

Render the image for the current attachment or content context, with aspect-ratio framing and optional grouped lightbox behavior. This is useful inside attachment/gallery loops where each loop item is already a media record.

Setup and First Use


Before starting, enable the relevant element or feature family under Bricks → BricksUltimate → General Elements, save, and reopen the Bricks editor. Integrations also require their corresponding plugin to be active.

  1. Enable Image Attachment and add (BU)Image Attachment inside an image-attachment loop or the intended content template.
  2. Use a gallery query that supplies attachment records, such as Product Galleries or an appropriate ACF/Meta Box gallery integration.
  3. Set Resolution and Image aspect ratio for the intended thumbnail frame.
  4. Set Image min width(px) only when necessary and test narrow layouts.
  5. Choose Link to: None, a supported attachment/file destination, or Lightbox.
  6. For grouped lightboxes, set Outer container selector to the actual unique gallery wrapper and configure the optional alt, caption, and thumbnails.

Controls and Settings


ControlPurpose and usage
Image sourceThere is no ordinary single-image picker: the element resolves the current context. It first tries an attachment, then a featured image or supported WooCommerce item/product image fallback.
ResolutionSelect an image size appropriate to the rendered frame. Default: large.
Image aspect ratioDefines the frame, for example 16:9. It can crop or reframe an image rather than alter the source asset.
Image min width(px)A layout constraint; overly large values can force mobile overflow.
Link to / Lightbox image sizeChoose how clicking behaves and the size used for a larger lightbox image.
Outer container selectorScopes lightbox grouping to the correct gallery wrapper. Captions, alt display, thumbnails, and thumbnail placement belong to the lightbox presentation.

Context and Fallbacks


Inside an attachment loop, the record must be a valid image attachment. For content records, a featured image can be used. Supported WooCommerce contexts can use a product image, a variation parent image, or a configured placeholder. This does not mean every arbitrary object loop has an image source.

Alternative Text and Performance


Populate media alternative text and captions in the Media Library. The optional Show alt control relates to the lightbox display; it is not a reason to omit image alt text. Use the right thumbnail resolution and avoid full-size assets in dense grids. There is no documented lazy-loading toggle on this element equivalent to the separate BU Product Image control.

Practical Example


Inside a Product Galleries loop, place one Image Attachment element, set a square ratio, and link to Lightbox. Give the outer gallery an unambiguous selector so only that product's images are grouped.

Troubleshooting


  • Same image repeats: check the loop object/context, not just the media filename.
  • Image ID error: verify the attachment still exists and that the query supplies images.
  • Lightbox groups unrelated images: narrow the Outer container selector.
  • Mobile width issue: reduce Image min width and inspect the parent layout.

Related Documentation