S
S
scouser922021-05-18 01:32:44
1C-Bitrix
scouser92, 2021-05-18 01:32:44

How to configure CNC for bitrix:catalog so that the URL of the product card is without a section and without a slash at the end?

Greetings. Please help.

The address structure is as follows:
the directory section contains the entire nesting chain, i.e., for example, site.ru/catalog/sukhofrukty/ananas/
respectively, in the component in the "SEF_URL_TEMPLATES" section we write "section" => "#SECTION_CODE_PATH#/" , everything is clear

here, but the address of the product card should be like this: site.ru/catalog/sushenyy-ananas , i.e. no sections, just a symbolic product code, but without a slash at the end
in the component settings, I wrote "element" => "#ELEMENT_CODE#" without a slash

, if you put a slash at the end, then everything works, but if you don't use a slash at the end, then enters the product card,site.ru/catalog/ - the error

got into the component itself in the component.php file - there the required page is connected with the line
$this->IncludeComponentTemplate($componentPage);
and when going to /catalog/ the $componentPage variable is equal to "element" although it should be "sections"

i.e. the component thinks that we are moving to a detailed card, when we access the directory root
, I suspect that it's all about the slash
, how to be, display the component in its own namespace and customize it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
I'm Yoda, 2021-05-18
@Anadi

In the infoblock settings, configure the url generation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question