J
J
jakiro700002021-05-04 18:48:07
1C-Bitrix
jakiro70000, 2021-05-04 18:48:07

How to make CNC in Bitrix instead of ID - a symbolic code for a self-written element?

There is a self-written element that has a detailed page.
Detail page output:

$APPLICATION->IncludeComponent(
                    'ugsever:vacancy',
                    '',
                    array('ELEMENT_ID' => $_REQUEST['ELEMENT_ID'])
                );

this array displays a detailed page by ID, how to make the detailed page displayed not by ID, but by the symbolic code of the element?
Tried editing urlrewrite:
array (
    'CONDITION' => '#^/vacancies/([0-9]+)/.*#',
    'RULE' => 'ELEMENT_CODE=$1',
    'ID' => 'bitrix:news.list',
    'PATH' => '/vacancies/detail.php',
    'SORT' => 100,
  ),

I tried to set a detailed page by type
#SITE_DIR#/vacancies/#ELEMENT_CODE#/
in the infoblock settings. It feels like it does not react to the infoblock settings at all, what could be wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2021-05-05
@kikher

1. check that the section has a character code.
2. check the component settings. Detail view page = #ELEMENT_CODE#
3. if it doesn't work, try displaying it via your native news.list with the same settings, if it works, look for a problem in 'ugsever:vacancy'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question