Remember me

Masonry/Metro Grid

7 years 6 months ago #1

  • Pete's Avatar
  • Pete
Hi - I want to make a grid that will render images proportionally into a Metro style grid, automatically without being a fixed format layout like Metro Grid..


i.e.

A B C C
D B E F
G G K K
L L K K

where
A = 1x1
B = 1x2
C = 2x1
D = 1x1
E = 1x1
F = 1x1
G = 2x1
K = 2x2
L = 2x1

Is this possible?

Basically if the next image on the list is proportionately 2xwider then give it 2 width, etc, and roll back and fill in the blanks if possible with 1x1s

Images would have to be created to be multipls of the 1x1 size (i.e. 500x500 1000x500 500x1000 etc)

Thanks
Pete

7 years 6 months ago #2

  • Artem's Avatar
  • Artem
  • Posts: 11342
Hi Pete,

You can try to do it by yourself,

Go to:
components/com_bagallery/helpers/bagallery.php
lines: 618 - 624

there you will find code which building Metro layout
$height2[] = 5*$i+5; // it's a 2x2
$width2[] = 5*$i+5; // it's a 2x2
$width2[] = 7*$i+9; // it's a 2x1
$height2[] = 14*$i+2; // it's a1x2

You can try to play with this options

Regards,
Powered by Kunena Forum