From cd812ecbf414e0792b407a4731ffa830d22ba323 Mon Sep 17 00:00:00 2001 From: Jonathan Miller <230051081+jmiller-moko@users.noreply.github.com> Date: Wed, 8 Apr 2026 00:00:14 -0500 Subject: [PATCH] Fix breadcrumbs: stop double-filtering, add showHere support Joomla core already handles showHome/showLast/homeText before passing $list to the template. Removed duplicate filtering that was breaking those settings. Added showHere param to control "You are here" label visibility. Bump to 03.09.11. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/html/mod_breadcrumbs/default.php | 44 ++++++---------------------- src/templateDetails.xml | 2 +- 2 files changed, 10 insertions(+), 36 deletions(-) diff --git a/src/html/mod_breadcrumbs/default.php b/src/html/mod_breadcrumbs/default.php index 96e741e..b81fc8c 100644 --- a/src/html/mod_breadcrumbs/default.php +++ b/src/html/mod_breadcrumbs/default.php @@ -10,49 +10,20 @@ /** * Default layout override for mod_breadcrumbs. * Bootstrap 5 breadcrumb with schema.org BreadcrumbList markup. - * Respects showHome, showLast, homeText module settings. + * Module settings (showHome, showLast, homeText) are handled by Joomla core + * before $list reaches this template. */ defined('_JEXEC') or die; -use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; -use Joomla\CMS\Router\Route; -use Joomla\CMS\Uri\Uri; - -Factory::getApplication()->getLanguage()->load('mod_breadcrumbs', JPATH_SITE); $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'); -$showHome = $params->get('showHome', 1); -$showLast = $params->get('showLast', 1); -$homeText = $params->get('homeText', '') ?: Text::_('MOD_BREADCRUMBS_HOME'); +$showHere = $params->get('showHere', 1); -// Build filtered list respecting module settings -$items = []; -$count = count($list); - -foreach ($list as $key => $item) { - // Skip Home item if showHome is off - if ($key === 0 && !$showHome) { - continue; - } - - // Replace Home text if custom homeText is set - if ($key === 0 && $showHome) { - $item->name = $homeText; - } - - // Skip last item if showLast is off - if ($key === $count - 1 && !$showLast) { - continue; - } - - $items[] = $item; -} - -if (empty($items)) { +if (empty($list)) { return; } ?> @@ -60,9 +31,12 @@ if (empty($items)) { showtitle) : ?> < class="mod-breadcrumbs__title">title; ?>> + + +