Merge pull request #12398 from MarekBenjamin/image-grid-fixes
Fixed image grid when exactly ONE portrait and ONE landscape is attached
This commit is contained in:
commit
ed805d1af2
|
@ -3175,13 +3175,22 @@ class Item
|
||||||
// Mix of landscape and portrait images.
|
// Mix of landscape and portrait images.
|
||||||
if ($lcount == $pcount) {
|
if ($lcount == $pcount) {
|
||||||
// equal amount of landscapes and portraits
|
// equal amount of landscapes and portraits
|
||||||
for ($l = 0; $l < $lcount; $l++) {
|
if ($lcount == 1) {
|
||||||
if ($l % 2 == 0) {
|
// one left / one right
|
||||||
$images_fc[] = $landscapeimages[$l];
|
$images_fc[] = $landscapeimages[0];
|
||||||
$images_fc[] = $portraitimages[$l];
|
$images_sc[] = $portraitimages[0];
|
||||||
} else {
|
} else {
|
||||||
$images_sc[] = $portraitimages[$l];
|
// Distribute equal to both columns
|
||||||
$images_sc[] = $landscapeimages[$l];
|
for ($l = 0; $l < $lcount; $l++) {
|
||||||
|
if ($l % 2 == 0) {
|
||||||
|
// landscape left and portrait right for even numbers
|
||||||
|
$images_fc[] = $landscapeimages[$l];
|
||||||
|
$images_fc[] = $portraitimages[$l];
|
||||||
|
} else {
|
||||||
|
// portraits left and landscape right for odd numbers
|
||||||
|
$images_sc[] = $portraitimages[$l];
|
||||||
|
$images_sc[] = $landscapeimages[$l];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user