Changes before error encountered
Co-authored-by: jmiller-moko <230051081+jmiller-moko@users.noreply.github.com>
This commit is contained in:
@@ -33,9 +33,9 @@ $document = $app->getDocument();
|
|||||||
$wa = $document->getWebAssetManager();
|
$wa = $document->getWebAssetManager();
|
||||||
|
|
||||||
// Template params
|
// Template params
|
||||||
$params_LightColorName = (string) $this->params->get('colorLightName', 'colors_standard'); // colors_standard|colors_alternative|colors_custom
|
$params_LightColorName = (string) $this->params->get('colorLightName', 'standard'); // standard|alternative|custom
|
||||||
|
|
||||||
$params_DarkColorName = (string) $this->params->get('colorDarkName', 'colors_standard'); // colors_standard|colors_alternative|colors_custom
|
$params_DarkColorName = (string) $this->params->get('colorDarkName', 'standard'); // standard|alternative|custom
|
||||||
|
|
||||||
$params_googletagmanager = $this->params->get('googletagmanager', false);
|
$params_googletagmanager = $this->params->get('googletagmanager', false);
|
||||||
$params_googletagmanagerid = $this->params->get('googletagmanagerid', null);
|
$params_googletagmanagerid = $this->params->get('googletagmanagerid', null);
|
||||||
|
|||||||
@@ -29,9 +29,9 @@ $params = $this->params;
|
|||||||
$wa = $this->getWebAssetManager();
|
$wa = $this->getWebAssetManager();
|
||||||
|
|
||||||
// Template params
|
// Template params
|
||||||
$params_LightColorName = (string) $params->get('colorLightName', 'colors_standard'); // colors_standard|colors_alternative|colors_custom
|
$params_LightColorName = (string) $params->get('colorLightName', 'standard'); // standard|alternative|custom
|
||||||
|
|
||||||
$params_DarkColorName = (string) $params->get('colorDarkName', 'colors_standard'); // colors_standard|colors_alternative|colors_custom
|
$params_DarkColorName = (string) $params->get('colorDarkName', 'standard'); // standard|alternative|custom
|
||||||
|
|
||||||
$params_googletagmanager = $params->get('googletagmanager', false);
|
$params_googletagmanager = $params->get('googletagmanager', false);
|
||||||
$params_googletagmanagerid = $params->get('googletagmanagerid', '');
|
$params_googletagmanagerid = $params->get('googletagmanagerid', '');
|
||||||
@@ -66,14 +66,14 @@ $colorDarkKey = strtolower(preg_replace('/[^a-z0-9_.-]/i', '', $params_DarkColo
|
|||||||
$lightKey = 'template.light.' . $colorLightKey;
|
$lightKey = 'template.light.' . $colorLightKey;
|
||||||
$darkKey = 'template.dark.' . $colorDarkKey;
|
$darkKey = 'template.dark.' . $colorDarkKey;
|
||||||
try {
|
try {
|
||||||
$wa->useStyle('template.light.colors_standard');
|
$wa->useStyle('template.light.standard');
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
$wa->registerAndUseStyle('template.light.colors_standard', $templatePath . '/css/theme/light.standard.css');
|
$wa->registerAndUseStyle('template.light.standard', $templatePath . '/css/theme/light.standard.css');
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
$wa->useStyle('template.dark.colors_standard');
|
$wa->useStyle('template.dark.standard');
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
$wa->registerAndUseStyle('template.dark.colors_standard', $templatePath . '/css/theme/dark.standard.css');
|
$wa->registerAndUseStyle('template.dark.standard', $templatePath . '/css/theme/dark.standard.css');
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
$wa->useStyle($lightKey);
|
$wa->useStyle($lightKey);
|
||||||
|
|||||||
@@ -45,9 +45,9 @@ $document = $app->getDocument();
|
|||||||
$wa = $document->getWebAssetManager();
|
$wa = $document->getWebAssetManager();
|
||||||
|
|
||||||
// Template params
|
// Template params
|
||||||
$params_LightColorName = (string) $this->params->get('colorLightName', 'colors_standard'); // colors_standard|colors_alternative|colors_custom
|
$params_LightColorName = (string) $this->params->get('colorLightName', 'standard'); // standard|alternative|custom
|
||||||
|
|
||||||
$params_DarkColorName = (string) $this->params->get('colorDarkName', 'colors_standard'); // colors_standard|colors_alternative|colors_custom
|
$params_DarkColorName = (string) $this->params->get('colorDarkName', 'standard'); // standard|alternative|custom
|
||||||
|
|
||||||
$params_googletagmanager = $this->params->get('googletagmanager', false);
|
$params_googletagmanager = $this->params->get('googletagmanager', false);
|
||||||
$params_googletagmanagerid = $this->params->get('googletagmanagerid', null);
|
$params_googletagmanagerid = $this->params->get('googletagmanagerid', null);
|
||||||
@@ -88,34 +88,20 @@ $templatePath = 'media/templates/site/mokocassiopeia';
|
|||||||
// Core template CSS
|
// Core template CSS
|
||||||
$wa->useStyle('template.base'); // css/template.css
|
$wa->useStyle('template.base'); // css/template.css
|
||||||
|
|
||||||
// Color theme (light + optional dark)
|
// Theme palettes (light + dark)
|
||||||
$colorLightKey = strtolower(preg_replace('/[^a-z0-9_.-]/i', '', $params_LightColorName));
|
// Always load standard theme, then load custom if selected
|
||||||
$colorDarkKey = strtolower(preg_replace('/[^a-z0-9_.-]/i', '', $params_DarkColorName));
|
$wa->useStyle('template.light.standard');
|
||||||
$lightKey = 'template.light.' . $colorLightKey;
|
$wa->useStyle('template.dark.standard');
|
||||||
$darkKey = 'template.dark.' . $colorDarkKey;
|
|
||||||
|
|
||||||
try {
|
// Load custom or alternative themes if selected
|
||||||
$wa->useStyle('template.light.colors_standard');
|
if ($params_LightColorName === 'custom') {
|
||||||
} catch (\Throwable $e) {
|
$wa->useStyle('template.light.custom');
|
||||||
$wa->registerAndUseStyle('template.light.colors_standard', $templatePath . '/css/theme/light.standard.css');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
if ($params_DarkColorName === 'custom') {
|
||||||
$wa->useStyle('template.dark.colors_standard');
|
$wa->useStyle('template.dark.custom');
|
||||||
} catch (\Throwable $e) {
|
} elseif ($params_DarkColorName === 'alternative') {
|
||||||
$wa->registerAndUseStyle('template.dark.colors_standard', $templatePath . '/css/theme/dark.standard.css');
|
$wa->useStyle('template.dark.alternative');
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
$wa->useStyle($lightKey);
|
|
||||||
} catch (\Throwable $e) {
|
|
||||||
$wa->registerAndUseStyle('template.light.dynamic', $templatePath . '/css/theme/light.' . $colorLightKey . '.css');
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
$wa->useStyle($darkKey);
|
|
||||||
} catch (\Throwable $e) {
|
|
||||||
$wa->registerAndUseStyle('template.dark.dynamic', $templatePath . '/css/theme/dark.' . $colorDarkKey . '.css');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scripts
|
// Scripts
|
||||||
|
|||||||
@@ -65,13 +65,13 @@
|
|||||||
"attributes": {"media": "all"}
|
"attributes": {"media": "all"}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "template.light.colors_standard",
|
"name": "template.light.standard",
|
||||||
"type": "style",
|
"type": "style",
|
||||||
"uri": "media/templates/site/mokocassiopeia/css/theme/light.standard.css",
|
"uri": "media/templates/site/mokocassiopeia/css/theme/light.standard.css",
|
||||||
"attributes": {"media": "all"}
|
"attributes": {"media": "all"}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "template.light.colors_standard.min",
|
"name": "template.light.standard.min",
|
||||||
"type": "style",
|
"type": "style",
|
||||||
"uri": "media/templates/site/mokocassiopeia/css/theme/light.standard.min.css",
|
"uri": "media/templates/site/mokocassiopeia/css/theme/light.standard.min.css",
|
||||||
"attributes": {"media": "all"}
|
"attributes": {"media": "all"}
|
||||||
@@ -89,13 +89,13 @@
|
|||||||
"attributes": {"media": "all"}
|
"attributes": {"media": "all"}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "template.dark.colors_standard",
|
"name": "template.dark.standard",
|
||||||
"type": "style",
|
"type": "style",
|
||||||
"uri": "media/templates/site/mokocassiopeia/css/theme/dark.standard.css",
|
"uri": "media/templates/site/mokocassiopeia/css/theme/dark.standard.css",
|
||||||
"attributes": {"media": "all"}
|
"attributes": {"media": "all"}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "template.dark.colors_standard.min",
|
"name": "template.dark.standard.min",
|
||||||
"type": "style",
|
"type": "style",
|
||||||
"uri": "media/templates/site/mokocassiopeia/css/theme/dark.standard.min.css",
|
"uri": "media/templates/site/mokocassiopeia/css/theme/dark.standard.min.css",
|
||||||
"attributes": {"media": "all"}
|
"attributes": {"media": "all"}
|
||||||
|
|||||||
@@ -187,13 +187,13 @@
|
|||||||
|
|
||||||
<!-- Variables & Palettes -->
|
<!-- Variables & Palettes -->
|
||||||
<field name="theme_sep_vars" type="spacer" label="Variables & Palettes" hr="false" class="text fw-bold" />
|
<field name="theme_sep_vars" type="spacer" label="Variables & Palettes" hr="false" class="text fw-bold" />
|
||||||
<field name="colorLightName" type="list" label="TPL_MOKOCASSIOPEIA_COLOR_LIGHT_NAME_LABEL" hint="TPL_MOKOCASSIOPEIA_COLOR_LIGHT_NAME_DESC" default="colors_standard">
|
<field name="colorLightName" type="list" label="TPL_MOKOCASSIOPEIA_COLOR_LIGHT_NAME_LABEL" hint="TPL_MOKOCASSIOPEIA_COLOR_LIGHT_NAME_DESC" default="standard">
|
||||||
<option value="colors_standard">TPL_MOKOCASSIOPEIA_COLOR_NAME_STANDARD</option>
|
<option value="standard">TPL_MOKOCASSIOPEIA_COLOR_NAME_STANDARD</option>
|
||||||
<option value="colors_custom">TPL_MOKOCASSIOPEIA_COLOR_NAME_CUSTOM</option>
|
<option value="custom">TPL_MOKOCASSIOPEIA_COLOR_NAME_CUSTOM</option>
|
||||||
</field>
|
</field>
|
||||||
<field name="colorDarkName" type="list" label="TPL_MOKOCASSIOPEIA_COLOR_DARK_NAME_LABEL" hint="TPL_MOKOCASSIOPEIA_COLOR_DARK_NAME_DESC" default="colors_standard">
|
<field name="colorDarkName" type="list" label="TPL_MOKOCASSIOPEIA_COLOR_DARK_NAME_LABEL" hint="TPL_MOKOCASSIOPEIA_COLOR_DARK_NAME_DESC" default="standard">
|
||||||
<option value="colors_standard">TPL_MOKOCASSIOPEIA_COLOR_NAME_STANDARD</option>
|
<option value="standard">TPL_MOKOCASSIOPEIA_COLOR_NAME_STANDARD</option>
|
||||||
<option value="colors_custom">TPL_MOKOCASSIOPEIA_COLOR_NAME_CUSTOM</option>
|
<option value="custom">TPL_MOKOCASSIOPEIA_COLOR_NAME_CUSTOM</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<!-- Typography -->
|
<!-- Typography -->
|
||||||
|
|||||||
Reference in New Issue
Block a user