Module overrides with showtitle, suffix, and header_tag support + CSS
New default.php overrides for 11 Joomla core modules: - mod_custom (default + updated hero layout) - mod_articles_latest, mod_articles_popular, mod_articles_news - mod_articles_category, mod_breadcrumbs, mod_footer - mod_login (BS5 form with FA7 icons), mod_finder (BS5 search) - mod_tags_popular (badge layout), mod_tags_similar, mod_related_items All overrides consistently respect: - $module->showtitle — renders title only when enabled - header_tag param — configurable heading level (h1-h6) - header_class param — custom CSS class on the title - moduleclass_sfx — custom suffix class on the wrapper CSS additions in template.css: - Shared __title styles for all module headings - List styling for article/tag/related modules - Newsflash card layout, tag badges, search form, login form - Breadcrumb and footer module styling Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
48
src/html/mod_finder/default.php
Normal file
48
src/html/mod_finder/default.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
/**
|
||||
* Default layout override for mod_finder (Smart Search).
|
||||
* Bootstrap 5 search form with showtitle support.
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
$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');
|
||||
?>
|
||||
<div class="mod-finder<?php echo $suffix ? ' ' . $suffix : ''; ?>">
|
||||
<?php if ($module->showtitle) : ?>
|
||||
<<?php echo $headerTag; ?> class="mod-finder__title<?php echo $headerClass ? ' ' . $headerClass : ''; ?>"><?php echo $module->title; ?></<?php echo $headerTag; ?>>
|
||||
<?php endif; ?>
|
||||
<form action="<?php echo Route::_($route); ?>" method="get" class="mod-finder__form" role="search">
|
||||
<div class="input-group">
|
||||
<label for="mod-finder-searchword-<?php echo $module->id; ?>" class="visually-hidden">
|
||||
<?php echo Text::_('COM_FINDER_SEARCH_LABEL'); ?>
|
||||
</label>
|
||||
<input type="search" name="q" id="mod-finder-searchword-<?php echo $module->id; ?>"
|
||||
class="form-control" value="<?php echo htmlspecialchars($app->getInput()->get('q', '', 'string'), ENT_COMPAT, 'UTF-8'); ?>"
|
||||
placeholder="<?php echo Text::_('COM_FINDER_SEARCH_LABEL'); ?>">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<span class="fa-solid fa-magnifying-glass" aria-hidden="true"></span>
|
||||
<span class="visually-hidden"><?php echo Text::_('COM_FINDER_SEARCH_LABEL'); ?></span>
|
||||
</button>
|
||||
</div>
|
||||
<?php if ($params->get('show_autosuggest', 1)) : ?>
|
||||
<?php $app->getDocument()->getWebAssetManager()->useScript('awesomplete'); ?>
|
||||
<?php endif; ?>
|
||||
<input type="hidden" name="option" value="com_finder">
|
||||
<input type="hidden" name="Itemid" value="<?php echo $route; ?>">
|
||||
</form>
|
||||
</div>
|
||||
Reference in New Issue
Block a user