C
C
chelnokov_a2020-12-25 12:37:38
1C-Bitrix
chelnokov_a, 2020-12-25 12:37:38

How to make different section and subsection of a directory in bitrix?

All an example. I'm getting acquainted with Bitrix and ran into a problem.

There is a subsection template https://pateder.ru/tverdinay/construction_home.html (instead of product card forms)
There is a template for the main section https://pateder.ru/tverdinay/construction.html

As you can see, they are different.
I implement a catalog through a complex component. But I can’t figure out how to make the section differ from the subsection in terms of layout and information output. Point me in the right direction to think.

I don't even know how to ask Google a question.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yaroslav Alexandrov, 2020-12-25
@alexyarik

Just in a complex component, nothing prevents you from getting the section data and checking the current level in the array and defining the parent [DEPTH_LEVEL] = 1 and then write your own conditions in PHP and connect one or another component template, up to your own set of components.
See GetIBlockSection API https://dev.1c-bitrix.ru/api_help/iblock/functions...

A
Anton, 2020-12-25
@anton99zel

Use a shorthand php condition in the component to specify this or that template for sections/subsections...

$APPLICATION->IncludeComponent(
    "bitrix:catalog.section",
false !==strstr($arResult['VARIABLES']['SECTION_CODE_PATH'],'kottedji') ? 'default' : 'custom'),
    Array(
        "ACTION_VARIABLE" => "action",
        "ADD_PICT_PROP" => "MORE_PHOTO",
        ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question