#kubirubi# компонент хлебных крошек
<?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 .= '<div class="breds"><a href="/" title="Главная страница">Главная страница</a> / <a href="/catalog/" title="Каталог">Каталог</a> / ';
$itemSize = count($arResult["SECTIONS"]);
for($index = 0; $index < $itemSize; $index++)
{
$title = htmlspecialcharsex($arResult["SECTIONS"][$index]["NAME"]);
$arrow = ($index > 0? ' / ' : '');
$strReturn .= '
'.$arrow.'<a href="'.$arResult["SECTIONS"][$index]["SECTION_PAGE_URL"].'" title="'.$title.'">'.$title.'</a>';
}
$strReturn .= '</div>';
echo $strReturn;
<?
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();
/**
* @global CMain $APPLICATION
* @var CBitrixComponent $this
*/
if ($arParams["SITE_ID"] === false)
$path = $arParams["PATH"];
else
$path = Array($arParams["SITE_ID"], $arParams["PATH"]);
$arSelect = Array("ID", "NAME", "DATE_ACTIVE_FROM", 'PROPERTY_MARKET_SECTION');
$arFilter = Array("IBLOCK_ID"=>2, "ACTIVE"=>"Y", 'ID' => $arParams['ID_ELEMENT']);
CModule::IncludeModule("iblock");
$res = CIBlockElement::GetList(Array(), $arFilter, false, false, $arSelect);
if($ob = $res->fetch())
{
$MainSectionId = $ob['PROPERTY_MARKET_SECTION_VALUE'];
}
$nav = CIBlockSection::GetNavChain(2, $MainSectionId);
while($arSectionPath = $nav->GetNext()){
$arResult['SECTIONS'][] = $arSectionPath;
}
$this->IncludeComponentTemplate();