A
A
Andrey Enkin2021-05-24 15:49:47
1C-Bitrix
Andrey Enkin, 2021-05-24 15:49:47

How to make a page with an embedded URL in the catalog on Bitrix?

There is a directory on Bitrix with addressing like /catalog/CATEGORY/PRODUCT/ .
The catalog is implemented through a standard Bitrix component, products = infoblock elements.
I need to add a manual for each product.
It should be located at the address of the form /catalog/CATEGORY/PRODUCT/MANUAL , the structure of the address cannot be changed, because the addresses are already printed in QR on the packages.
The manual must have its own template, part of the information is taken from the product, part is its own text (html field)

How to do this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
PetrPo, 2021-05-26
@Enkin

Just in case, I will write how to do it.
1. In the parameters of the complex component, in SEF_URL_TEMPLATES, you need to add your key, which must match "element" + the desired prefix

"SEF_URL_TEMPLATES" => array(
  //...........
  "element" => "#SECTION_CODE_PATH#/#ELEMENT_CODE#/",
  "manual" => "#SECTION_CODE_PATH#/#ELEMENT_CODE#/myprotectionproduct/manual/",
)

2. The manual.php file must be added to the complex component template, in which the element ID / CODE will be available in the $arResult['VARIABLES'] array, by which you can understand which element we are in, then you can do everything on this page the same as on others, for example, in element.php
3. there is also a .parameters.php file, add at the end
$arTemplateParameters['SEF_URL_TEMPLATES_manual'] = array(
    'PARENT' => 'SEF_MODE',
    'NAME' => GetMessage('PARAMETER_SEF_URL_TEMPLATES_MANUAL'),
    "DEFAULT" => "",
    "VARIABLES" => array(),
);

this is so that when saving the component from the public, your parameter is not erased, GetMessage('PARAMETER_SEF_URL_TEMPLATES_MANUAL') - you need to add it to the lang file, add the /lang/ru/.parameters.php folder here
$MESS['PARAMETER_SEF_URL_TEMPLATES_MANUAL'] = 'Мануал';

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question