Без последней страницы (только разделы)
Знак домика -
Раздел -
Подраздел Код |
---|
<?
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
//delayed function must return a string
if(empty($arResult))
return "";
$strReturn = '<div id="breadcrumb"><a title="'.GetMessage('BREADCRUMB_MAIN').'" href="'.SITE_DIR.'"><img width="12" height="11" src="/bitrix/templates/'.SITE_TEMPLATE_ID.'/images/home.gif" alt="'.GetMessage('BREADCRUMB_MAIN').'" /></a>';
for($index = 0, $itemSize = count($arResult); $index < $itemSize; $index++)
{
$strReturn .= '<i>–</i>';
$title = htmlspecialcharsex($arResult[$index]["TITLE"]);
if($arResult[$index]["LINK"] <> "")
$strReturn .= '<a href="'.$arResult[$index]["LINK"].'" title="'.$title.'">'.$title.'</a>';
else
$strReturn .= '<span>'.$title.'</span>';
}
$strReturn .= '</div>';
return $strReturn;
?>
|
Если последний пункт не оформлять ссылкой:
меняем
Код |
---|
if($arResult[$index]["LINK"] <> "") |
на
Код |
---|
if($arResult[$index]["LINK"] <> ""&&$index<(count($arResult)-1)) |
Знак домика -
Раздел - Подраздел
получаем
Код |
---|
<?
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
//delayed function must return a string
if(empty($arResult))
return "";
$strReturn = '<div id="breadcrumb"><a title="'.GetMessage('BREADCRUMB_MAIN').'" href="'.SITE_DIR.'"><img width="12" height="11" src="/bitrix/templates/'.SITE_TEMPLATE_ID.'/images/home.gif" alt="'.GetMessage('BREADCRUMB_MAIN').'" /></a>';
for($index = 0, $itemSize = count($arResult); $index < $itemSize; $index++)
{
$strReturn .= '<i>–</i>';
$title = htmlspecialcharsex($arResult[$index]["TITLE"]);
if($arResult[$index]["LINK"] <> ""&&$index<(count($arResult)-1))
$strReturn .= '<a href="'.$arResult[$index]["LINK"].'" title="'.$title.'">'.$title.'</a>';
else
$strReturn .= '<span>'.$title.'</span>';
}
$strReturn .= '</div>';
return $strReturn;
?> |