I
I
I'm Yoda2019-01-18 08:34:35
1C-Bitrix
I'm Yoda, 2019-01-18 08:34:35

How to implement such a transition through the pages?

Hello connoisseurs!
Please tell me how to implement the following?
There is such a directory structure: Directory / Section / Element_main
To the "Element_main" of the catalog, through its binding to the elements of ib, elements from another ib are attached. On the "Element_master" detail page, we see a list of linked elements.
How to make it so that when clicking on the linked element on the "Element_main" detail page, we go to the page of the linked element, but the address in the browser line was Catalog / Section / Element_main / linked_element
UPD
at this address, currently throws in the root of the directory.
There is an assumption that it is necessary to create a rule in urlrewrite.php, but I can’t think of what kind yet.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya, 2019-01-18
@Anadi

How to make it so that when clicking on the linked element on the "Element_main" detail page, we go to the page of the linked element, but the address in the browser line is Directory/Section/Element_main/linked_element

Easily. Let's consider the steps.
1. In sections.php of the catalog complex component template, we get the current address, parse it.
2. By parsing the address, we can determine which directory object (root, section, or element) is being called.
3. If a catalog element is called, we take the element code from the address, fill in the $arResult["VARIABLES"] array and include the element.php file.
4. Otherwise, we display what we have written in sections.php (that is, the root of the directory, there are usually TOP elements).

A
Ainur Valiev, 2019-01-18
@vaajnur

no way. the bound element is the same element. the url for it is formed as for all elements.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question