From 7b1c22588f7ee58a6ab83771b696dafe4758a187 Mon Sep 17 00:00:00 2001 From: Moritz Sauer <43135946+moritz-sauer-13@users.noreply.github.com> Date: Tue, 10 Sep 2024 16:13:57 +0200 Subject: [PATCH] Update ElementContentExtension.php --- src/Extensions/ElementContentExtension.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Extensions/ElementContentExtension.php b/src/Extensions/ElementContentExtension.php index 99e27ab..b6df4f6 100644 --- a/src/Extensions/ElementContentExtension.php +++ b/src/Extensions/ElementContentExtension.php @@ -193,9 +193,11 @@ private function getLayoutOptions(): array $img->getURL(); } } + $project = new \SilverStripe\Core\Manifest\Module(BASE_PATH, BASE_PATH); + $resourcesDir = $project->getResourcesDir() ?: '_resources'; $options[$layoutID] = [ 'title' => $layoutVar['title'], - 'image' => ($img) ? Director::absoluteBaseURL() . '/resources/' . $img : '', + 'image' => ($img) ? Director::absoluteBaseURL() . '/' . $resourcesDir . '/' . $img : '', ]; } }