Masonry layout can break if there are multiple displays of the same view on the same page

Created on 12 December 2023, 7 months ago

Problem/Motivation

The masonry layout can break if there are multiple displays of the same view on the same page, because the css selector for the container is solely based on the view id. It may only be evident if some displays have grouping and others don't.

Steps to reproduce

Install masonry views,
Create a view with multiple block displays, each with a masonry format. Place all blocks on the same page.

Proposed resolution

Update the container selector defined in masonry_views_preprocess_views_view_masonry and applied in masonry_views_preprocess_views_view to include the current display.

πŸ› Bug report
Status

Needs review

Version

4.0

Component

Code

Created by

πŸ‡³πŸ‡ΏNew Zealand somatick

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @somatick
  • πŸ‡³πŸ‡ΏNew Zealand somatick

    Patch attached which adds current display to the container class name

  • πŸ‡³πŸ‡ΏNew Zealand somatick

    Oops I didn't notice the .txt extension when I saved locally. Same patch

  • Status changed to Needs review 7 months ago
  • πŸ‡³πŸ‡ΏNew Zealand Chroid

    Thanks @somatick!

    Have tested this on a development site of ours and can confirm the patch applies cleanly and resolves the layout issues we were facing for multiple blocks of the same view on the page!

Production build 0.69.0 2024