R
R
Roma Cockenshtuff2016-03-04 09:59:46
1C-Bitrix
Roma Cockenshtuff, 2016-03-04 09:59:46

How to make breadcrumbs work in bitrix?

News > Reviews > News > Reviews - this is displayed on all pages
of the component template code:

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

//delayed function must return a string
if(empty($arResult))
  return "";

$strReturn = '<ul class="breadcrumb-navigation">';

// echo "<pre>";
// print_r($arResult);
// exit;

for($index = 0, $itemSize = count($arResult); $index < $itemSize; $index++)
{
  if($index > 0)
    $strReturn .= '<li><span>&nbsp;&gt;&nbsp;</span></li>';

  $title = htmlspecialchars($arResult[$index]["TITLE"]);
  if($arResult[$index]["LINK"] <> "")
    $strReturn .= '<li><a href="'.$arResult[$index]["LINK"].'" title="'.$title.'">'.$title.'</a></li>';
  else
    $strReturn .= '<li>'.$title.'</li>';
}

$strReturn .= '</ul>';
return $strReturn;
?>

component call code
<?$APPLICATION->IncludeComponent("bitrix:breadcrumb","",Array(
                "START_FROM" => "0", 
                "PATH" => "", 
                "SITE_ID" => "s1" 
            )
        );?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rad1calDreamer, 2016-03-04
@LesterTheMolester

look in the components for options related to INCLUDE_IBLOCK_INTO_CHAIN ​​or something like that. Well, check .sections.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question