From 4017e4597501cb6c0dbae5f794d32b99c75ca3c1 Mon Sep 17 00:00:00 2001 From: Jonathan Miller <230051081+jmiller-moko@users.noreply.github.com> Date: Thu, 2 Apr 2026 18:46:17 -0500 Subject: [PATCH] Module overrides with showtitle, suffix, and header_tag support + CSS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- src/html/mod_articles_category/default.php | 75 +++++++++++ src/html/mod_articles_category/index.html | 76 +++++++++++ src/html/mod_articles_latest/default.php | 40 ++++++ src/html/mod_articles_latest/index.html | 76 +++++++++++ src/html/mod_articles_news/default.php | 58 +++++++++ src/html/mod_articles_news/index.html | 76 +++++++++++ src/html/mod_articles_popular/default.php | 38 ++++++ src/html/mod_articles_popular/index.html | 76 +++++++++++ src/html/mod_breadcrumbs/default.php | 45 +++++++ src/html/mod_breadcrumbs/index.html | 76 +++++++++++ src/html/mod_custom/default.php | 39 ++++++ src/html/mod_custom/hero.php | 12 +- src/html/mod_finder/default.php | 48 +++++++ src/html/mod_finder/index.html | 76 +++++++++++ src/html/mod_footer/default.php | 30 +++++ src/html/mod_footer/index.html | 76 +++++++++++ src/html/mod_login/default.php | 123 ++++++++++++++++++ src/html/mod_login/index.html | 76 +++++++++++ src/html/mod_related_items/default.php | 44 +++++++ src/html/mod_related_items/index.html | 76 +++++++++++ src/html/mod_tags_popular/default.php | 41 ++++++ src/html/mod_tags_popular/index.html | 76 +++++++++++ src/html/mod_tags_similar/default.php | 38 ++++++ src/html/mod_tags_similar/index.html | 76 +++++++++++ src/media/css/template.css | 141 +++++++++++++++++++++ 25 files changed, 1604 insertions(+), 4 deletions(-) create mode 100644 src/html/mod_articles_category/default.php create mode 100644 src/html/mod_articles_category/index.html create mode 100644 src/html/mod_articles_latest/default.php create mode 100644 src/html/mod_articles_latest/index.html create mode 100644 src/html/mod_articles_news/default.php create mode 100644 src/html/mod_articles_news/index.html create mode 100644 src/html/mod_articles_popular/default.php create mode 100644 src/html/mod_articles_popular/index.html create mode 100644 src/html/mod_breadcrumbs/default.php create mode 100644 src/html/mod_breadcrumbs/index.html create mode 100644 src/html/mod_custom/default.php create mode 100644 src/html/mod_finder/default.php create mode 100644 src/html/mod_finder/index.html create mode 100644 src/html/mod_footer/default.php create mode 100644 src/html/mod_footer/index.html create mode 100644 src/html/mod_login/default.php create mode 100644 src/html/mod_login/index.html create mode 100644 src/html/mod_related_items/default.php create mode 100644 src/html/mod_related_items/index.html create mode 100644 src/html/mod_tags_popular/default.php create mode 100644 src/html/mod_tags_popular/index.html create mode 100644 src/html/mod_tags_similar/default.php create mode 100644 src/html/mod_tags_similar/index.html diff --git a/src/html/mod_articles_category/default.php b/src/html/mod_articles_category/default.php new file mode 100644 index 0000000..a6b4b17 --- /dev/null +++ b/src/html/mod_articles_category/default.php @@ -0,0 +1,75 @@ + + * + * This file is part of a Moko Consulting project. + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +/** + * Default layout override for mod_articles_category. + * Adds showtitle support and respects module settings. + */ + +defined('_JEXEC') or die; + +use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Language\Text; + +if (empty($list)) { + return; +} + +$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'); +?> +
+ showtitle) : ?> + < class="mod-articles-category__title">title; ?>> + + +
diff --git a/src/html/mod_articles_category/index.html b/src/html/mod_articles_category/index.html new file mode 100644 index 0000000..1a6c6cf --- /dev/null +++ b/src/html/mod_articles_category/index.html @@ -0,0 +1,76 @@ + + + + + + + Redirecting… + + + + + + + + + + + + + + + + + + + +
Redirecting to the site root… If you are not redirected, click here.
+ + diff --git a/src/html/mod_articles_latest/default.php b/src/html/mod_articles_latest/default.php new file mode 100644 index 0000000..4df78bb --- /dev/null +++ b/src/html/mod_articles_latest/default.php @@ -0,0 +1,40 @@ + + * + * This file is part of a Moko Consulting project. + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +/** + * Default layout override for mod_articles_latest. + * Adds showtitle support and respects module settings. + */ + +defined('_JEXEC') or die; + +use Joomla\CMS\Language\Text; + +if (empty($list)) { + return; +} + +$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'); +?> +
+ showtitle) : ?> + < class="mod-articles-latest__title">title; ?>> + + +
diff --git a/src/html/mod_articles_latest/index.html b/src/html/mod_articles_latest/index.html new file mode 100644 index 0000000..1a6c6cf --- /dev/null +++ b/src/html/mod_articles_latest/index.html @@ -0,0 +1,76 @@ + + + + + + + Redirecting… + + + + + + + + + + + + + + + + + + + +
Redirecting to the site root… If you are not redirected, click here.
+ + diff --git a/src/html/mod_articles_news/default.php b/src/html/mod_articles_news/default.php new file mode 100644 index 0000000..aa46eac --- /dev/null +++ b/src/html/mod_articles_news/default.php @@ -0,0 +1,58 @@ + + * + * This file is part of a Moko Consulting project. + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +/** + * Default layout override for mod_articles_news (newsflash). + * Adds showtitle support with card-based layout. + */ + +defined('_JEXEC') or die; + +if (empty($list)) { + return; +} + +$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'); +?> +
+ showtitle) : ?> + < class="mod-articles-news__title">title; ?>> + + +
+ get('item_title')) : ?> +

+ link !== '' && $params->get('link_titles')) : ?> + + + title; ?> + +

+ + + afterDisplayTitle)) : ?> + afterDisplayTitle; ?> + + + get('show_introtext', 1)) : ?> +
+ introtext; ?> +
+ + + readmore) && $item->readmore) : ?> + + +
+ +
diff --git a/src/html/mod_articles_news/index.html b/src/html/mod_articles_news/index.html new file mode 100644 index 0000000..1a6c6cf --- /dev/null +++ b/src/html/mod_articles_news/index.html @@ -0,0 +1,76 @@ + + + + + + + Redirecting… + + + + + + + + + + + + + + + + + + + +
Redirecting to the site root… If you are not redirected, click here.
+ + diff --git a/src/html/mod_articles_popular/default.php b/src/html/mod_articles_popular/default.php new file mode 100644 index 0000000..6d3c6be --- /dev/null +++ b/src/html/mod_articles_popular/default.php @@ -0,0 +1,38 @@ + + * + * This file is part of a Moko Consulting project. + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +/** + * Default layout override for mod_articles_popular. + * Adds showtitle support and respects module settings. + */ + +defined('_JEXEC') or die; + +if (empty($list)) { + return; +} + +$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'); +?> +
+ showtitle) : ?> + < class="mod-articles-popular__title">title; ?>> + + +
diff --git a/src/html/mod_articles_popular/index.html b/src/html/mod_articles_popular/index.html new file mode 100644 index 0000000..1a6c6cf --- /dev/null +++ b/src/html/mod_articles_popular/index.html @@ -0,0 +1,76 @@ + + + + + + + Redirecting… + + + + + + + + + + + + + + + + + + + +
Redirecting to the site root… If you are not redirected, click here.
+ + diff --git a/src/html/mod_breadcrumbs/default.php b/src/html/mod_breadcrumbs/default.php new file mode 100644 index 0000000..8b6782f --- /dev/null +++ b/src/html/mod_breadcrumbs/default.php @@ -0,0 +1,45 @@ + + * + * This file is part of a Moko Consulting project. + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +/** + * Default layout override for mod_breadcrumbs. + * Bootstrap 5 breadcrumb with schema.org BreadcrumbList markup. + */ + +defined('_JEXEC') or die; + +use Joomla\CMS\Language\Text; + +$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'); +?> + diff --git a/src/html/mod_breadcrumbs/index.html b/src/html/mod_breadcrumbs/index.html new file mode 100644 index 0000000..1a6c6cf --- /dev/null +++ b/src/html/mod_breadcrumbs/index.html @@ -0,0 +1,76 @@ + + + + + + + Redirecting… + + + + + + + + + + + + + + + + + + + +
Redirecting to the site root… If you are not redirected, click here.
+ + diff --git a/src/html/mod_custom/default.php b/src/html/mod_custom/default.php new file mode 100644 index 0000000..5e03a50 --- /dev/null +++ b/src/html/mod_custom/default.php @@ -0,0 +1,39 @@ + + * + * This file is part of a Moko Consulting project. + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +/** + * Default layout override for mod_custom. + * Adds showtitle support and respects all module settings. + */ + +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] + ); +} +?> +
+ showtitle) : ?> + < class="mod-custom__title">title; ?>> + + content; ?> +
diff --git a/src/html/mod_custom/hero.php b/src/html/mod_custom/hero.php index 75102ed..d7368d6 100644 --- a/src/html/mod_custom/hero.php +++ b/src/html/mod_custom/hero.php @@ -18,8 +18,10 @@ defined('_JEXEC') or die; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Uri\Uri; -$modId = 'mod-custom' . $module->id; -$moduleclass = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8'); +$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 */ @@ -30,9 +32,11 @@ if ($params->get('backgroundimage')) { ); } ?> - -