S
S
Sergey Chazov2022-02-20 13:46:47
1C-Bitrix
Sergey Chazov, 2022-02-20 13:46:47

How to form CNC for an element in the root in an infoblock with sections?

There is an infoblock with sections. I display elements of the infoblock using the bitrix:news component. The NC generation template for an element looks like this #SECTION_CODE_PATH#/#ELEMENT_CODE#/
Elements that are inside categories are displayed without problems. And the elements that lie at the root form an incorrect link to a detailed view of the news. I understand why this happens (obviously because it is looking for a category with the name of the infoblock element, but there is no such one), but I do not understand how to fix it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Chazov, 2022-02-20
@chazovs

I read the doc) Excerpt: "if you need the same nesting level, then use prefixes (or postfixes) when generating links. For example, in the Section field, specify section-#SECTION_CODE#/, and in the Detailed information field - detail-#ELEMENT_CODE#/".
This solves the problem.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question