A
A
Askfortrue2019-09-27 08:48:48
1C-Bitrix
Askfortrue, 2019-09-27 08:48:48

Creation of a multi-level CNC in a separate folder on the Catalog section list and catalog section. How?

Good afternoon
I'm trying to figure out how to create a multi-level CNC shared directory, if you display a section and its subsections in a separate folder.
The CNC of the form /new_page/#SECTION_CODE#/#ELEMENT_CODE#/ was created using the index.php, list.php and detail.php pages, according to the well-known master class.
On this question remains open, I don’t understand how to create a CNC like /new_page/#SECTION_CODE_PATH#/
Create subsections (physical) in a folder and place more and more directory levels with specific IDs there?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2019-09-27
Madzhugin @Suntechnic

You almost answered your own question:
So use a complex component with a configured SECTION_CODE_PATH.
If religion or common sense forbids you to use a complex component, then this is also solved - the easiest way is to combine list.php and detail.php into one file and wrap ALL urls like /new_page/something/something/there/else/ , taking only the last token into the variable ( still in this case). Next, you check if you have a section with this code, and if so, display the section component, and if not, the element component with this code.
In this case, you will encounter the following problems:
if you have a section and an element with the same codes, then the section will be displayed.
the output data will not depend on something / something / there, and in these tokens it will be possible to write any kind of nonsense.
You can fix this by placing the entire url in a variable - something/something/there/else.
In this case, you will need to completely parse it in the file, make sure, and after finding the entity , check whether the path matches something/something/there. In this way, you are practically implementing a piece of a complex component in a script (but I think that this is still better than using a complex component).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question