Skip to content

Instantly share code, notes, and snippets.

@sartas
Created February 16, 2014 09:23
Show Gist options
  • Select an option

  • Save sartas/9031650 to your computer and use it in GitHub Desktop.

Select an option

Save sartas/9031650 to your computer and use it in GitHub Desktop.
main menu
<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true)
{
die();
} ?>
<nav class="main-nav">
<?
$cur_page = $APPLICATION->GetCurPage();
foreach ($arResult as $key => $arItem): ?>
<? if ($arItem['SELECTED'] && $arItem['LINK'] == $cur_page): ?>
<span class="active"><?= $arItem['TEXT'] ?></span>
<? elseif ($arItem['SELECTED']): ?>
<a class="active" href="<?= $arItem['LINK'] ?>"><?= $arItem['TEXT'] ?></a>
<?
else: ?>
<a href="<?= $arItem['LINK'] ?>"><?= $arItem['TEXT'] ?></a>
<?endif; ?>
<? endforeach; ?>
</nav>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment