J
J
Jupiter Max2018-07-09 05:43:32
1C-Bitrix
Jupiter Max, 2018-07-09 05:43:32

How to display an infoblock on a specific page of the Bitrix section?

Hello.
I have a "Specialists" section. It has subsections with added elements.
Task: Show specialists exactly on the elements (that is, pages), and not in sections and subsections.
Since I have a place for this functionality in the header, I display them with a check on the section The problem is that in the "Specialists" section there are "Narrow specialists" and it has a bunch of subsections "Specialist 1", "Specialist 2" and etc. + they are always added. Accordingly, my check clings only to the main service section. The question is how to check for a specific specialist in the main section, given that their list is displayed in the header, and not on a specific page. Thanks in advance
if(CSite::InDir('/service')):

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Filippenko, 2018-07-09
@alexfilus

if(substr_count('/service',$APPLICATION->GetCurDir())):

K
Kudis, 2018-07-09
@kudis

you can add a rule to $urlrewrite that will pass the specialist ID to the request $_REQUEST['PERSON_ID']

array(
        "CONDITION" => "#^/service/.+?/([^\/]+)/#",
        "RULE" => "PERSON_ID=\$1",
        "ID" => "",
        "PATH" => "/service/index.php",
    ),

this variable will be available in the header, where you will receive it and, if available, display an infoblock for a specific employee

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question