Skip to content

Commit

Permalink
inherit image size from module settings in news lister
Browse files Browse the repository at this point in the history
  • Loading branch information
saibotd committed Apr 29, 2020
1 parent 9b075f4 commit 713054e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Resources/contao/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
}

0 comments on commit 713054e

Please sign in to comment.