Skip to content

Некликабельные хлебные крошки

Здравствуйте. Хочу сделать чтобы последняя ссылка в хлебных крошках не была кликабельной.

Нашел код, который формирует хлебные крошки:

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

if( empty( $arResult ) )
	return "";
// pr($arResult);
$strReturn = '<ul class="breadcrumb">';

for( $index = 0, $itemSize = count($arResult); $index < $itemSize; $index++ ){
	$title = htmlspecialcharsex($arResult[$index]["TITLE"]);
	if( $arResult[$index]["LINK"] <> "")
		$strReturn .= '<li><a href="'.$arResult[$index]["LINK"].'" title="'.$title.'">'.$title.'</a></li>';
	else{
		$strReturn .= '<li class="active">'.$title.'</li>';
		break;
	}
}

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

Пытался сделать сам, однако не слишком силен в php. просба подскахать как это реализовать.

 

Featured Replies

if( $arResult[$index]["LINK"] <> "")

Заменить на

 

if( $arResult[$index]["LINK"] <> "" AND $index < $itemSize) 

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.