Answer the question
In order to leave comments, you need to log in
How to display a section, subsection and infoblock elements?
hello everyone
I am displaying the catalog in bitrix
catalog section top (it doesn’t work through section list and just section too) I
need such a structure
Section of the first level
Section of the second level
Elements
Code
<div class="panel-group smt-panel-group smt-panel-group_colored smt-panel-group_services">
<?$countSection = 0;?>
<?foreach($arResult["SECTIONS"] as $arSection):?>
<?if ($arSection["DEPTH_LEVEL"] < 2):?>
<?$isOpenSection = (isset($arSection["UF_OPEN"]) && $arSection["UF_OPEN"]) || $countSection == 0;?>//условие нажат ли раздел 1-го уровня
<div class="panel smt-panel-primary <?if($isOpenSection):?>smt-panel-primary_in<?endif?>">
<div class="panel-heading">
<div class="panel-title" id="<?=$this->GetEditAreaId('section_'.$arSection['ID']);?>"><a name="smt-accordion-primary-item-<?=$arSection['ID']?>"></a><a data-toggle="collapse" href="#smt-accordion-primary-item-<?=$arSection['ID']?>"><?=$arSection["NAME"]?></a></div>
</div>
<div class="panel-collapse collapse <?if($isOpenSection):?>in<?endif?>" id="smt-accordion-primary-item-<?=$arSection['ID']?>">
<div class="panel-body">
//ВОТ В ЭТУ ЧАСТЬ МНЕ НУЖНО ВЫВЕСТИ $arSection["DEPTH_LEVEL"] == 2 И ЕГО ЭЛЕМЕНТЫ, ЧТОБЫ ОНО БЫЛО СКРЫТО ПОКА ПОЛЬЗОВАТЕЛЬ НЕ НАЖАЛ
//КАК МНЕ ЭТО СДЕЛАТЬ ЕСЛИ У МЕНЯ СТОИТ УСЛОВИЕ $arSection["DEPTH_LEVEL"] == 1
<table class="table table-striped table-hover smt-table smt-table_services">
<tbody class="hideseek-data">
<? $count = 0; ?>
<?foreach($arSection["ITEMS"] as $arItem):?>
<tr id="<?=$this->GetEditAreaId($arItem['ID']);?>">
<td><?=$arItem["NAME"]?></td>
<td><?=$arItem["DISPLAY_PROPERTIES"]["PRICE"]["DISPLAY_VALUE"]?></td>
</tr>
<?endforeach?>
</tbody>
</table>
</div>
</div>
</div>
<?endif?>
<?$countSection += 1;?>
<?endforeach;?>
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question