Кто знает как вывести разделы первого уровня из инфоблока Каталог. Вот шаблон компонента catalog.section.list.
Отображаются разделы первого уровня, а так же подразделы. Нужно только разделы первого уровня.
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>
<ul class="items-tile">
<?
$TOP_DEPTH = $arResult["SECTION"]["DEPTH_LEVEL"];
$CURRENT_DEPTH = $TOP_DEPTH;
foreach($arResult["SECTIONS"] as $arSection)
{
$this->AddEditAction($arSection['ID'], $arSection['EDIT_LINK'], CIBlock::GetArrayByID($arSection["IBLOCK_ID"], "SECTION_EDIT"));
$this->AddDeleteAction($arSection['ID'], $arSection['DELETE_LINK'], CIBlock::GetArrayByID($arSection["IBLOCK_ID"], "SECTION_DELETE"), array("CONFIRM" => GetMessage('CT_BCSL_ELEMENT_DELETE_CONFIRM')));
if($CURRENT_DEPTH < $arSection["DEPTH_LEVEL"])
{
echo "\n",str_repeat("\t", $arSection["DEPTH_LEVEL"]-$TOP_DEPTH),"";
}
elseif($CURRENT_DEPTH == $arSection["DEPTH_LEVEL"])
{
echo "";
}
else
{
while($CURRENT_DEPTH > $arSection["DEPTH_LEVEL"])
{
echo "";
echo "\n",str_repeat("\t", $CURRENT_DEPTH-$TOP_DEPTH),"","\n",str_repeat("\t", $CURRENT_DEPTH-$TOP_DEPTH-1);
$CURRENT_DEPTH--;
}
echo "\n",str_repeat("\t", $CURRENT_DEPTH-$TOP_DEPTH),"";
}
echo "\n",str_repeat("\t", $arSection["DEPTH_LEVEL"]-$TOP_DEPTH);
?>
<li id="<?=$this->GetEditAreaId($arSection['ID']);?>" class="before after ease-out"><div class="pd20">
<div class="h4"><a href="<?=$arSection["SECTION_PAGE_URL"]?>"><?=$arSection["NAME"]?></a></div>
<div class="content text-small mb10"><?=$arSection["DESCRIPTION"]?></div>
</div></li>
<?
$CURRENT_DEPTH = $arSection["DEPTH_LEVEL"];
}
while($CURRENT_DEPTH > $TOP_DEPTH)
{
echo "";
echo "\n",str_repeat("\t", $CURRENT_DEPTH-$TOP_DEPTH),"","\n",str_repeat("\t", $CURRENT_DEPTH-$TOP_DEPTH-1);
$CURRENT_DEPTH--;
}
?>
</ul>
if ($arSection["DEPTH_LEVEL"] == 1)
? Также dev.1c-bitrix.ru/user_help/components/content/catalog/…