43 lines
1.5 KiB
PHP
43 lines
1.5 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Copyright (C) 2025 Moko Consulting <hello@mokoconsulting.tech>
|
||
|
|
*
|
||
|
|
* This file is part of a Moko Consulting project.
|
||
|
|
*
|
||
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||
|
|
*/
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Template override for mod_custom adding banner-overlay wrapper pattern.
|
||
|
|
* Based on Cassiopeia's banner layout approach.
|
||
|
|
*/
|
||
|
|
|
||
|
|
defined('_JEXEC') or die;
|
||
|
|
|
||
|
|
use Joomla\CMS\HTML\HTMLHelper;
|
||
|
|
use Joomla\CMS\Uri\Uri;
|
||
|
|
|
||
|
|
$modId = 'mod-custom' . $module->id;
|
||
|
|
$suffix = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');
|
||
|
|
$headerTag = htmlspecialchars($params->get('header_tag', 'h3'), ENT_COMPAT, 'UTF-8');
|
||
|
|
$headerClass = htmlspecialchars($params->get('header_class', ''), ENT_COMPAT, 'UTF-8');
|
||
|
|
|
||
|
|
if ($params->get('backgroundimage')) {
|
||
|
|
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||
|
|
$wa = $app->getDocument()->getWebAssetManager();
|
||
|
|
$wa->addInlineStyle(
|
||
|
|
'#' . $modId . '{background-image: url("' . Uri::root(true) . '/' . HTMLHelper::_('cleanImageURL', $params->get('backgroundimage'))->url . '");}',
|
||
|
|
['name' => $modId]
|
||
|
|
);
|
||
|
|
}
|
||
|
|
?>
|
||
|
|
<div class="mod-custom custom banner-overlay custom-hero<?php echo $suffix ? ' ' . $suffix : ''; ?>" id="<?php echo $modId; ?>">
|
||
|
|
<div class="overlay">
|
||
|
|
<?php if ($module->showtitle) : ?>
|
||
|
|
<<?php echo $headerTag; ?> class="mod-custom__title<?php echo $headerClass ? ' ' . $headerClass : ''; ?>"><?php echo $module->title; ?></<?php echo $headerTag; ?>>
|
||
|
|
<?php endif; ?>
|
||
|
|
<?php echo $module->content; ?>
|
||
|
|
</div>
|
||
|
|
</div>
|