In the Breadcrumbs module you can choose to show "Home" or not. If selected there is another field to change the home title - fine. But as soon as you have selected the "Home" to be shown, there will always be shown a divider BEFORE this first item as well. If you don't want it to show you could hide the divider by CSS of course, but it would be much better to choose in the breadcrumbs module itself. So option to select or deselect the divider is missing.
If you select "Home" in breadcrumbs to be shown, there should be another possibility to select the divider or not.
It would be an easy fix, but I am not so familiar with PRs yet, I will describe it here and will do the PR later. :)
Files to be changed:
modules\mod_breadcrumbs\mod_breadcrumbs.xml
add after line 36:
<field name="showFirstDivider" type="radio" label="MOD_BREADCRUMBS_FIELD_SHOWFIRSTDIVIDER_LABEL" layout="joomla.form.field.radio.switcher" default="1" filter="integer" showon="showHome:1"> <option value="0">JHIDE</option> <option value="1">JSHOW</option> </field>
language\en-GB\mod_breadcrumbs.ini
add after line 10:
MOD_BREADCRUMBS_FIELD_SHOWFIRSTDIVIDER_LABEL="Show divider before Home"
modules\mod_breadcrumbs\tmpl\default.php
original code:
<?php if ($params->get('showHere', 1)) : ?> <li class="mod-breadcrumbs__here float-start"> <?php echo Text::_('MOD_BREADCRUMBS_HERE'); ?>  </li> <?php else : ?> <li class="mod-breadcrumbs__divider float-start"> <span class="divider icon-location icon-fw" aria-hidden="true"></span> </li> <?php endif; ?>
changed code:
<?php if ($params->get('showHere', 1)) : ?> <li class="mod-breadcrumbs__here float-start"> <?php echo Text::_('MOD_BREADCRUMBS_HERE'); ?>  </li> <?php else : ?> <?php if ($params->get('showFirstDivider', 1)) : ?> <li class="mod-breadcrumbs__divider float-start"> <span class="divider icon-location icon-fw" aria-hidden="true"></span> </li> <?php endif; ?> <?php endif; ?>
Labels |
Added:
No Code Attached Yet
|
The code works as you can see in the screenshot - the yellow marked line is not visible in Joomla core. It shows already my fix which I describe with code. Hope this clearifies it. ;)
The code works as you can see in the screenshot
I mean a screenshot of the result in the frontend, through a template override.
Labels |
Added:
?
|
Thank you for your helpful hints! Now I see, that the template framework (Gantry in this case) shows an icon with CSS, but without template override of the breadcrumbs module itself.
See the yellow marked icon before "Startseite" (frontend) and below source code:
It's the source code from core.
The logic in the code is:
With option "You are here" enabled (and not "show home", as I mistakenly assumed) => Show text "You are here:" (before "Home").
Without this option => Don't show "You are here:", but insert source code of an empty list element. It depends of the template if an icon will be shown in frontend or not, but the code of a list element will be inserted.
@brianteeman If you'll have a look into your code of "with home" or "without home", you will see the code for the empty list element with class "mod-breadcrumbs__divider" as well, although it has no impact in frontend.
I am just wondering for what this code is good for? Is it a sort of wildcard for template developers to use it for showing icons as Gantry did? My little fix would give you the possibility to get rid of this divider list element if you don't need it.
But the problem would be that if somebody want's to show a divider icon and would select this option by purpose, he would be disappointed if he would see no change in frontend in case his template does not offer this. I will rethink about it but probably will close the issue because the solution of my "little problem" can't be solved this way without other issues.
I hope you will better understand know what I mean ... at least I do so. ;)
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-04-21 16:03:38 |
Closed_By | ⇒ | pixelhexe |
Can you clarify what you mean with a template override? You can paste your code in there. And make an image of it.
Then you can also test whether your code works.