Answer the question
In order to leave comments, you need to log in
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
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.
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
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
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>
<?$filter_7 = array('SECTION_ID'=>"34", 'ACTIVE'=>'Y');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question