Please always enter the name of the template and the Joomla version and the live URL if available

[GELÖST] Breadcrumbs

[GELÖST] Breadcrumbs was created by WB-Autoservice

Posted 1 year 6 months ago #31149
Joomla 4 / template tp_power

Hallo, before Home im Breadcrumbs mochte ich gerne ein Haus (bild). Aber den code

<i class="fas fa-home" :: before </i>

dem gebraucht werde fur Menu Home ist das uberhaupt der richtige und who soll man die schreiben?
gr. Hennie

Please Log in or Create an account to join the conversation.

Replied by WB-Autoservice on topic [GELÖST] Breadcrumbs

Posted 1 year 6 months ago #31154
Nobody? :-(

Please Log in or Create an account to join the conversation.

Replied by Administrator on topic [GELÖST] Breadcrumbs

Posted 1 year 5 months ago #31524
Maybe a little bit late.

But try this:

Make an override of this module:



Then change the default.php to this code:
Code:
<?php /** * @package Joomla.Site * @subpackage mod_breadcrumbs * * @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Router\Route; use Joomla\CMS\Uri\Uri; use Joomla\CMS\WebAsset\WebAssetManager; ?> <nav class="mod-breadcrumbs__wrapper" aria-label="<?php echo htmlspecialchars($module->title, ENT_QUOTES, 'UTF-8'); ?>"> <ol class="mod-breadcrumbs breadcrumb px-3 py-2"> <?php if ($params->get('showHere', 1)) : ?> <li class="mod-breadcrumbs__here float-start"> <?php echo Text::_('MOD_BREADCRUMBS_HERE'); ?>&#160; </li> <?php else : ?> <li class="mod-breadcrumbs__divider float-start"> <span class="divider icon-location icon-fw" aria-hidden="true"></span> </li> <?php endif; ?> <?php // Get rid of duplicated entries on trail including home page when using multilanguage for ($i = 0; $i < $count; $i++) { if ($i === 1 && !empty($list[$i]->link) && !empty($list[$i - 1]->link) && $list[$i]->link === $list[$i - 1]->link) { unset($list[$i]); } } // Find last and penultimate items in breadcrumbs list end($list); $last_item_key = key($list); prev($list); $penult_item_key = key($list); // Make a link if not the last item in the breadcrumbs $show_last = $params->get('showLast', 1); $class = null; // Generate the trail foreach ($list as $key => $item) : if ($params->get('showHome', 1) && $key === 0) { // Store name for ld+json. $savedName = $item->name; $item->name = '<i class="fas fa-home"></i>'; } if ($key !== $last_item_key) : if (!empty($item->link)) : $breadcrumbItem = HTMLHelper::_('link', Route::_($item->link), '<span>' . $item->name . '</span>', ['class' => 'pathway']); else : $breadcrumbItem = '<span>' . $item->name . '</span>'; endif; echo '<li class="mod-breadcrumbs__item breadcrumb-item' . $class . '">' . $breadcrumbItem . '</li>'; elseif ($show_last) : // Render last item if required. $breadcrumbItem = '<span>' . $item->name . '</span>'; $class = ' active'; echo '<li class="mod-breadcrumbs__item breadcrumb-item' . $class . '">' . $breadcrumbItem . '</li>'; endif; endforeach; ?> </ol> <?php // Structured data as JSON $data = [ '@context' => 'https://schema.org', '@type' => 'BreadcrumbList', 'itemListElement' => [] ]; // Use an independent counter for positions. E.g. if Heading items in pathway. $itemsCounter = 0; // If showHome is disabled use the fallback $homeCrumb for startpage at first position. if (isset($homeCrumb)) { $data['itemListElement'][] = [ '@type' => 'ListItem', 'position' => ++$itemsCounter, 'item' => [ '@id' => Route::_($homeCrumb->link, true, Route::TLS_IGNORE, true), 'name' => $homeCrumb->name, ], ]; } foreach ($list as $key => $item) { if ($key === 0 && isset($savedName)) { $item->name = $savedName; } // Only add item to JSON if it has a valid link, otherwise skip it. if (!empty($item->link)) { $data['itemListElement'][] = [ '@type' => 'ListItem', 'position' => ++$itemsCounter, 'item' => [ '@id' => Route::_($item->link, true, Route::TLS_IGNORE, true), 'name' => $item->name, ], ]; } elseif ($key === $last_item_key) { // Add the last item (current page) to JSON, but without a link. // Google accepts items without a URL only as the current page. $data['itemListElement'][] = [ '@type' => 'ListItem', 'position' => ++$itemsCounter, 'item' => [ 'name' => $item->name, ], ]; } } if ($itemsCounter) { /** @var WebAssetManager $wa */ $wa = $app->getDocument()->getWebAssetManager(); $wa->addInline('script', json_encode($data, JSON_UNESCAPED_UNICODE), [], ['type' => 'application/ld+json']); } ?> </nav>

Then it looks like this:

JP-Admin
Joomla-Meister im forum.joomla.de
Last Edit:1 year 5 months ago by Administrator
Attachments:
Last edit: 1 year 5 months ago by Administrator.

Please Log in or Create an account to join the conversation.

Moderators: joomlaplates

Installations-Service

Don´t waste your time, we install your purchased Template
with the "Demo Content" within the next 24 hours.

Buy Now - 59€

Joomlaplates/Theme-Point is not affiliated with or endorsed by Open Source Matters or the Joomla! Project

Copyright © 2022 JoomlaPlates | Professional Joomla Templates with Uikit 3

Disclaimer & Privacy | License