M
M
Makfroy2019-07-17 09:24:36
1C-Bitrix
Makfroy, 2019-07-17 09:24:36

How to fix breadcrumbs in Bitrix?

Hello, I installed the bitrix breadcrum component, but they incorrectly show the page path, i.e. there generally displays the title of the site simply on the pages.
The code itself:

<?
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();

//delayed function must return a string
if(empty($arResult))
  return "";
  
$strReturn = '<div class="bx_breadcrumbs"><ul>';

$num_items = count($arResult);
for($index = 0, $itemSize = $num_items; $index < $itemSize; $index++)
{
  $title = htmlspecialcharsex($arResult[$index]["TITLE"]);
  
  if($arResult[$index]["LINK"] <> "" && $index != $itemSize-1)
    $strReturn .= '<li><a href="'.$arResult[$index]["LINK"].'" title="'.$title.'">'.$title.'</a></li>';
  else
    $strReturn .= '<li><span>'.$title.'</span></li>';
}

$strReturn .= '</ul><div class="clearboth"></div></div>';

return $strReturn;
?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dcode, 2019-07-17
@dcode

The "native" component correctly shows the breadcrumbs. The problem is somewhere else. Title is overridden, there are no .section.php files, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question