Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#2 | Schermafbeelding 2016-09-27 om 16.22.14.png | 796.65 KB | fbreckx |
Comments
Comment #2
fbreckx CreditAttribution: fbreckx commentedComment #3
taylormade415 CreditAttribution: taylormade415 commentedI 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?
Comment #4
bcobin CreditAttribution: bcobin commentedSame problem - just a single column. Any ideas here? Thanks...
Comment #5
Dom. CreditAttribution: Dom. commentedHi !
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 ?
Comment #6
bcobin CreditAttribution: bcobin commentedThank 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!
Comment #7
bcobin CreditAttribution: bcobin commentedOK - 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:
Hope this helps someone… thanks!
Comment #8
Dom. CreditAttribution: Dom. commentedThanks @bcobin for sharing !
Comment #9
Dom. CreditAttribution: Dom. commentedComment #10
zJoriz CreditAttribution: zJoriz commentedHmmm, 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 ;)
Comment #11
zJoriz CreditAttribution: zJoriz commentedMy 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.
Comment #12
Dom. CreditAttribution: Dom. commentedThanks @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.
Comment #14
Dom. CreditAttribution: Dom. commentedShould be fixed by the usage of 4.x, which should therefore simplify that.