Hi all,

Can't get Masonry Views to work. Everything seems fine, no problems at Status Report.
What's going on?

Using Masonry API 2.0.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fbreckx created an issue. See original summary.

fbreckx’s picture

taylormade415’s picture

I am also having this problem. @fbreckx, does this gallery wrap perfectly in the View's preview option? for sure, the live view page does not set a "masonry-layout" css class, but even when I add it to the View's css class setting, Masonry is never initialized on the masonry-items.

i haven't found a solution, but have tried every combination of settings and it seems to be a bug or conflict with our theme?

bcobin’s picture

Same problem - just a single column. Any ideas here? Thanks...

Dom.’s picture

Hi !
What about playing with the CSS ? Is it a sizing issue ? A display: block issue ? Is the masonry js loaded on the page ? Do you have console errors ?

bcobin’s picture

Thank you for the quick response - most encouraging! I won't be able to look further into this until later today, but I wanted to reach out soonest to thank you for the timely response. Hit you back a little later and again, thanks... looking forward!

bcobin’s picture

OK - I was able to get things working by using a combination of settings and some CSS.

Settings:

Add views row classes and striping
Column width units: Pixels
Resizable
Animated
Gutter width: 3px
Resizable and Animated: checked
Fit width, RTL layout, Load images first and Percent position: unchecked.

Here's the CSS:

@media screen and (min-width: 400px) and (max-width: 547px) {
.masonry-item {
width: 46%;
}
}

@media screen and (max-width: 399px) {
.masonry-item {
width: 100%;
}
}

Hope this helps someone… thanks!

Dom.’s picture

Thanks @bcobin for sharing !

Dom.’s picture

Status: Active » Closed (works as designed)
zJoriz’s picture

Hmmm, I'm not sure about "works as designed"... The options given in the UI suggest that we should be able to set up a working masonry system from there. I don't mind using css instead – gonna test in a minute if this solves my troubles as well – but I've been googling, testing, giving up and restarting way too long before ending up here!

It'd be nice if the css requirement was clear from the outset. Call it a feature request, if you will ;)

zJoriz’s picture

My masonry view also was stuck in one column (with each row on top of the other, actually). Until I read comment #19 in issue 3288460 that told me the gutter width should not contain the px affix.

I'm just leaving this here in case anyone else runs aground like nmillin and I did.

Dom.’s picture

Version: 7.x-3.0 » 8.x-1.x-dev
Assigned: Unassigned » Dom.
Status: Closed (works as designed) » Needs work

Thanks @zJoriz for your feedback.

Let me reopen: I guess I can provide an extra option for default CSS to help the site builders get the columns working more easily.
Also what can I do to improve the situation with gutter field ? Should I make it more tolerant to support the affix (I can trim it automatically for instance).

Note: I change this issue to 8.x, but this will be 2.x in the new release versioning system. Just saying that I won't support 7.x dev I guess.

  • Dom. committed 9dccda76 on 4.x
    Issue #2807283 by Dom.: Masonry Views: appears as 1 column
    
Dom.’s picture

Version: 8.x-1.x-dev » 4.x-dev
Status: Needs work » Fixed

Should be fixed by the usage of 4.x, which should therefore simplify that.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.