R
R
Rob1n Bobin2017-01-11 01:48:30
1C-Bitrix
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:
af59ad822d7249a68abd2733f7cd687f.png
-When I go to the section, the markup logic does not change:
0f867aa642ce483aa9ef5fdcb3aa88f3.png
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><?
          }
      }
      ?></ul></div><?
      break;
  }

Answer the question

In order to leave comments, you need to log in

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

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