diff --git a/config.json b/config.json
index ca49213..7505b30 100644
--- a/config.json
+++ b/config.json
@@ -1,5 +1,5 @@
{
- "version": "4.0.0",
+ "version": "4.1.0",
"name": "CmsPlugin.name",
"description": "CmsPlugin.description",
"icon": "bi bi-circle",
diff --git a/controllers/main.php b/controllers/main.php
index ca0d1c2..a349517 100644
--- a/controllers/main.php
+++ b/controllers/main.php
@@ -27,11 +27,19 @@ public function preAction()
// Use the same structure as that of the client portal for the company given
$this->structure->setDefaultView(APPDIR);
$this->structure->setView(null, 'client' . DS . $this->layout);
- $this->structure->set(
- 'custom_head',
- ''
- );
+
+ // A Bootstrap 5 client structure renders the Css helper and carries no custom_head, so
+ // the templates built on it load the stylesheet from views/{template}/main.pdt. Anything
+ // else is the other way around, and needs the link written into the head here, following
+ // the directory the view resolves to, which is settled per file when the view renders
+ if (self::getThemeFramework('client') !== self::FRAMEWORK_BOOTSTRAP_5) {
+ $view_dir = $this->getPluginViewDir('main') ?? $this->view->view;
+ $this->structure->set(
+ 'custom_head',
+ ''
+ );
+ }
$this->base_uri = WEBDIR;
$this->view->base_uri = $this->base_uri;
diff --git a/views/default/admin_main.pdt b/views/default/admin_main.pdt
index dd786a9..4c48597 100644
--- a/views/default/admin_main.pdt
+++ b/views/default/admin_main.pdt
@@ -25,15 +25,15 @@