From 713054e9c4ac431d32666e85f3ecd8a199535c6e Mon Sep 17 00:00:00 2001 From: Tobias Duehr Date: Wed, 29 Apr 2020 13:18:54 +0200 Subject: [PATCH] inherit image size from module settings in news lister --- src/Resources/contao/Hooks.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Resources/contao/Hooks.php b/src/Resources/contao/Hooks.php index 0977c8d..d7d9ba4 100644 --- a/src/Resources/contao/Hooks.php +++ b/src/Resources/contao/Hooks.php @@ -19,5 +19,15 @@ public static function apiModuleGenerated(ApiModule $module, string $moduleClass $module->numberOfItems, 0 ); + if ($_module->imgSize) { + foreach ($module->newsItems as $item) { + if (trim( + implode( + '', + StringUtil::deserialize($item->size) + ) + )) $item->size = $_module->imgSize; + } + } } }