S
S
Sorc Noir2015-09-29 00:22:48
PHP
Sorc Noir, 2015-09-29 00:22:48

Bitrix How to organize the display of a complete list of categories on all pages?

The pages have a Catalog component. With the help of the menu built into it, a list of categories is displayed. We go into one of the categories - the menu shows only child categories. The task is to make it so that on any page in the menu a complete list of categories is displayed. I rummaged through Google and Yandex for all sorts of requests, here I also looked at the toaster, nothing works.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
N
Nikita, 2015-09-29
@Rema1ns

Well, in general, your own structure is displayed, you either need to break the structure into 2 levels (parent -> child)
Or use the Bitrix framework and get the entire category branch.
By the way, if the memory does not change the TOP_DEPTH parameter of catalog.section.list, it just needs to be set more.

P
Pavel Shcheglov, 2015-09-29
@webfarrock

Try in section.php and sections.php
in the parameters of the bitrix:catalog.section.list component in the SECTION_ID SECTION_CODE
variables to set an empty string The data of the current section is passed to these variables, if this data is not present, the output comes from the root

I
Igor Karachentsev, 2015-09-30
@kucheriavij

https://dev.1c-bitrix.ru/api_help/iblock/classes/c...
in your case, it takes about 15 minutes, because you don’t have to bother with nesting

D
DM, 2020-03-18
@neverenn

An example of displaying a list of infoblock sections by ID.
Instead of SECTION_ID, you can use the infoblock ID, i.e. IBLOCK_ID or subsection ID of the infoblock section.

<ul id="liva">
      <?$filter_7 = array('SECTION_ID'=>"34", 'ACTIVE'=>'Y');
      $db_list_id7 = CIBlockSection::GetList(array(), $filter_7, true, Array("UF_DATE"));
      while ($arSect = $db_list_id7->GetNext()){
      $arSect["photo"] = CFile::GetPath($arSect["PICTURE"]);
      ?>

      <li id="liver">
        <a href="/<?=$arSect["CODE"]?>">
          <?=$arSect["NAME"]?>
        </a>
      </li>

      <? } ?>
    </ul>

Nesting depends on what you specify here:
<?$filter_7 = array('SECTION_ID'=>"34", 'ACTIVE'=>'Y');

If this is an infoblock, then the entire hierarchy of categories and sections will appear.
If this is an infoblock category, then the entire hierarchy of sections will be shown, and so on.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question