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:
@@ -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']) . '%';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user