I
I
IgorRastarov2017-04-05 13:42:38
1C-Bitrix
IgorRastarov, 2017-04-05 13:42:38

Why does Bitrix display the second level section as the main one?

Bitrix component:catalog:section:top

<?foreach($arResult["SECTIONS"] as $arSection):?>		
        <div>
            <div><?=$arSection["NAME"]?></a></div>
        </div>
    <div class="panel">
        <div class="panel-collapse collapse">
            <div class="body">
                <table class="table">
                    <tbody class="data">
                    <?if(!empty($arSection["ITEMS"])):?>
                    <?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?>
                    <?endif;?>				
                    </tbody>
                </table>		
            </div>
        </div>
    </div>
<?endforeach;?>
</div>

Here is the code
Instead of displaying
Section1
Subsection 1
Elements
It displays
Section1
Empty table
Subsection 1
Elements
Section 2
Subsection 2
Empty table
Elements
Although
I have 2 sections in the admin panel, it has subsections, subsections have elements.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Denisenko, 2017-04-11
@kapioprok

Hello, for the main and the catalog section, the templates of the complex component (bitrix.catalog) are different.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question