V
V
viktorulyushev2017-02-24 16:58:20
1C-Bitrix
viktorulyushev, 2017-02-24 16:58:20

Bitrix.Chain navigation?

There is a complex catalog component, it has 2 components - product card in detail and breadcrumb
A path is formed in breadcrumbs

$strReturn .= '<div class="bx-breadcrumb">';

$itemSize = count($arResult);
for($index = 0; $index < $itemSize; $index++)
{
  $title = htmlspecialcharsex($arResult[$index]["TITLE"]);

  $nextRef = ($index < $itemSize-2 && $arResult[$index+1]["LINK"] <> ""? ' itemref="bx_breadcrumb_'.($index+1).'"' : '');
  $child = ($index > 0? ' itemprop="child"' : '');
  $arrow = ($index > 0? '<i class="fa fa-angle-right"></i>' : '');

  if($arResult[$index]["LINK"] <> "" && $index != $itemSize-1)
  {

  }
  else
  {
    $strReturn .= '
      <ul class="crumbs">
        <li><a href="/index.php">Главная</a></li> <li><a href="'.$arResult[$index]["LINK"].'">'.$title.'</a></li> <li><a href="/catalog/secondhand">Подержаные погрузчики</a></li>
      </ul>';
  }
}

I added used forklifts myself because I can’t figure out how to form it. That is, my path when I go to the product should be like
this
How do I need the path? In the detailed product component, the name is formed like this
<?=$arResult['NAME']?>
if you insert it into the path, for example, like this '.$arResult['NAME'].' then it will be empty

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya, 2017-03-02
@viktorulyushev

Add crumbs code:
Paste this code into the template you need.
More details: https://dev.1c-bitrix.ru/api_help/main/reference/c...

V
viktorulyushev, 2017-02-24
@viktorulyushev

Array
(
    [0] => Array
        (
            [TITLE] => Каталог
            [LINK] => /catalog/
        )

)

this is a dump in breadcrumbs, i.e. nothing else goes there except this? how can I convey it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question