Skip to content

Commit

Permalink
Update ElementContentExtension.php
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz-sauer-13 authored Sep 10, 2024
1 parent e9da61b commit 7b1c225
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Extensions/ElementContentExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 : '',
];
}
}
Expand Down

0 comments on commit 7b1c225

Please sign in to comment.