This file is part of a Moko Consulting project. SPDX-License-Identifier: GPL-3.0-or-later # FILE INFORMATION DEFGROUP: Joomla.Template.Site INGROUP: MokoCassiopeia REPO: https://github.com/mokoconsulting-tech/MokoCassiopeia PATH: ./templates/mokocassiopeia/component.php VERSION: 03.06.02 BRIEF: Main template index file for MokoCassiopeia rendering site layout */ defined('_JEXEC') or die; use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Uri\Uri; use Joomla\CMS\Component\ComponentHelper; /** @var Joomla\CMS\Document\HtmlDocument $this */ $app = Factory::getApplication(); $input = $app->getInput(); $document = $app->getDocument(); $wa = $document->getWebAssetManager(); // Template params - Component uses minimal configuration $params_googletagmanager = $this->params->get('googletagmanager', false); $params_googletagmanagerid = $this->params->get('googletagmanagerid', null); $params_googleanalytics = $this->params->get('googleanalytics', false); $params_googleanalyticsid = $this->params->get('googleanalyticsid', null); $params_googlesitekey = $this->params->get('googlesitekey', null); if (!empty($params_googlesitekey)) { $this->setMetaData('google-site-verification', htmlspecialchars($params_googlesitekey, ENT_QUOTES, 'UTF-8')); } // Detecting Active Variables $option = $input->getCmd('option', ''); $view = $input->getCmd('view', ''); $layout = $input->getCmd('layout', ''); $task = $input->getCmd('task', ''); $itemid = $input->getCmd('Itemid', ''); $sitenameR = $app->get('sitename'); // raw for title composition $sitename = htmlspecialchars($sitenameR, ENT_QUOTES, 'UTF-8'); $menu = $app->getMenu()->getActive(); $pageclass = $menu !== null ? $menu->getParams()->get('pageclass_sfx', '') : ''; // Respect “Site Name in Page Titles” (0:none, 1:before, 2:after) $mode = (int) $app->get('sitename_pagetitles', 0); $pageTitle = trim($this->getTitle()); $final = $pageTitle !== '' ? ($mode === 1 ? $sitenameR . ' - ' . $pageTitle : ($mode === 2 ? $pageTitle . ' - ' . $sitenameR : $pageTitle)) : $sitenameR; $this->setTitle($final); // Template/Media path $templatePath = 'media/templates/site/mokocassiopeia'; // Core template CSS $wa->useStyle('template.base'); // css/template.css // Component always uses light theme only (no theme switching) $wa->useStyle('template.light.standard'); // css/theme/light.standard.css // Load Osaka font for site title $wa->useStyle('template.font.osaka'); // Brand: logo from params OR siteTitle // ------------------------------------- $brandHtml = ''; $logoFile = (string) $this->params->get('logoFile'); if ($logoFile !== '') { $brandHtml = HTMLHelper::_( 'image', Uri::root(false) . htmlspecialchars($logoFile, ENT_QUOTES, 'UTF-8'), $sitename, ['class' => 'logo d-inline-block', 'loading' => 'eager', 'decoding' => 'async'], false, 0 ); } else { // If no logo file, show the title (defaults to "MokoCassiopeia" if not set) $siteTitle = $this->params->get('siteTitle', 'MokoCassiopeia'); $brandHtml = '' . htmlspecialchars($siteTitle, ENT_COMPAT, 'UTF-8') . ''; } ?>