I have an information block structure that looks like this.
According to the idea, if I am on the website in the Линии
section, then the navigation chain should look like this
Категории / Красота / Линии
If for example in the Здоровье
section, then like this
Категории / Здоровье
But on all my pages I see this.
That is, all information blocks are taken in general, all possible paths, and displayed on the screen. It’s like I’m at the same time on 4 pages. Why it happens? And how to fix it?
Call component
<?$APPLICATION->IncludeComponent( "bitrix:breadcrumb", "breadcrumb2019", array( "START_FROM" => "0", "PATH" => "", "SITE_ID" => "-", "COMPONENT_TEMPLATE" => "breadcrumb2019" ), false );?>
Template
<?php if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die(); /** * @global CMain $APPLICATION */ global $APPLICATION; //echo '<pre>'; //var_dump($arResult); //exit(); //delayed function must return a string if(empty($arResult)) return ""; $strReturn = ''; //we can't use $APPLICATION->SetAdditionalCSS() here because we are inside the buffered function GetNavChain() $css = $APPLICATION->GetCSSArray(); if(!is_array($css) || !in_array("/bitrix/css/main/font-awesome.css", $css)) { $strReturn .= '<link href="'.CUtil::GetAdditionalFileURL("/bitrix/css/main/font-awesome.css").'" type="text/css" rel="stylesheet" />'."\n"; } $strReturn .= '<nav class="breadcrumbs">'; $itemSize = count($arResult); for($index = 0; $index < $itemSize; $index++) { $title = htmlspecialcharsex($arResult[$index]["TITLE"]); $arrow = ($index > 0? '<i class="fa fa-angle-right"></i>' : ''); if($arResult[$index]["LINK"] <> "" && $index != $itemSize-1) { $strReturn .= ' <a href="'.$arResult[$index]["LINK"].'" title="'.$title.'" itemprop="url">'. $title. '</a>'; } else { $strReturn .= ' <span itemprop="name">'.$title.'</span>'; } } $strReturn .= '</nav>'; return $strReturn;