Good day!

Faced such a problem. The last element of bread crumbs on the product card (product name) duplicates the contents of h1. Now H1 and the name of the product in breadcrumbs are taken from the SEO section. It is necessary that the last element was taken from the Item Name field.

For example: Now in breadcrumbs and H1 - Buy a yellow chair It should be: H1 - Buy a yellow chair, in crumbs - A yellow chair

How to solve this problem?

Crumb Output Code:

<?php if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die(); /** * @global CMain $APPLICATION */ global $APPLICATION; //delayed function must return a string if(empty($arResult)) return ""; $strReturn = ''; $strReturn .= '<span class="B_crumbBox">'; $itemSize = count($arResult); for($index = 0; $index < $itemSize; $index++) { $title = htmlspecialcharsex($arResult [$index]["TITLE"]); if($arResult[$index]["LINK"] <> "" && $index != $itemSize-1) { $strReturn .= ' <span class="B_firstCrumb"> <a href="'.$arResult[$index]["LINK"].'" title="'.$title.'" itemprop="url" class="B_homeCrumb">'.$title.'</a> </span> » '; } else { $strReturn .= ' <span class="B_lastCrumb"> <span class="B_currentCrumb">'.$title.'</span> </span>'; } } $strReturn .= '</span>'; return $strReturn; 

    1 answer 1

    For example, on the product page BEFORE the output of the “crumbs”, assign a unique variable to the name of the product

     $unique_variable = $arItem['NAME'] /**или как оно там выводится..*/; 

    but inside the crumbs component

     global $unique_variable; $strReturn .= ' <span class="B_lastCrumb"> <span class="B_currentCrumb">'.$unique_variable.'</span> </span>'; 

    Of course, it would be good to create and edit a special “crumb” template specifically for use on the product page in detail.