Merge pull request #13463 from MrPetovan/task/imagegrid-improvement

Rework image grid to horizontal masonry, allocate space for images to load
This commit is contained in:
Tobias Diekershoff 2023-09-24 12:59:10 +02:00 committed by GitHub
commit dd7bea4bd1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 149 additions and 48 deletions

View file

@ -1169,4 +1169,15 @@ class Media
}
return $url . $id;
}
/**
* Computes the allocated height value used in the content/image.tpl template based on a post-media record
*
* @param array $media A post-media record array
* @return string
*/
public static function getAllocatedHeightByMedia(array $media): string
{
return (100 * $media['height'] / $media['width']) . '%';
}
}