Rob1n Bobin2017-01-11 01:48:30
Rob1n Bobin, 2017-01-11 01:48:30

1c-bitrix Determining the nesting of sections?

There is a complete catalog.
It has 3 levels of nesting.
The essence of the problem is this:
-I use the full catalog for output
-Multilevel list view, this is how the start page of the equipment looks like:
-When I go to the section, the markup logic does not change:
As I understand it, both templates are taken from catalog.section.list.
I need the markup to be different when I go to the section, how can I change the logic?
There is an idea to write a condition in catalog.section.list based on the result of the nesting of the current section, but I can’t find the necessary call.
Maybe there are some other ways?
A piece of the catalog.section.list template:

case 'LIST':
      $intCurrentDepth = 1;
      $boolFirst = 1;
      foreach ($arResult['SECTIONS'] as &$arSection)
        $this->AddEditAction($arSection['ID'], $arSection['EDIT_LINK'], $strSectionEdit);
        $this->AddDeleteAction($arSection['ID'], $arSection['DELETE_LINK'], $strSectionDelete, $arSectionDeleteParams);
          if ($boolFirst){
            $boolFirst = 0;
            ?><div class="catalog-block"><h3><?echo $arSection["NAME"]?></h3><img src="<?=$arSection["PICTURE"]["SRC"]?>" title="<?=$arSection["NAME"]?>" border="0"/><ul><?
          elseif ($arSection['RELATIVE_DEPTH_LEVEL'] == 2){
            ?><li><a href="<? echo $arSection['SECTION_PAGE_URL']; ?>"><?echo $arSection["NAME"];?></a></li><?
          elseif ($arSection['RELATIVE_DEPTH_LEVEL'] == 1){
            ?></ul></div><div class="catalog-block"><h3><?echo $arSection["NAME"];?></h3><img src="<?=$arSection["PICTURE"]["SRC"]?>" title="<?=$arSection["NAME"]?>" border="0"/><ul><?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Alexey Zakharov, 2017-01-11

It's not entirely clear what you want. When you're at the root of a directory, the sections.php file works. When you go to the section, the file in section.php works, in it, as well as in the root, section.list is called, you can change the component template there

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question