S
S
Sergey Ryzhkin2021-03-02 09:54:41
1C-Bitrix
Sergey Ryzhkin, 2021-03-02 09:54:41

How to display the values ​​of custom infoblock properties in a template?

Tell me, in which direction to dig in the Bitrix help to figure out how to define variables?

Made inf. block and specified two additional properties as text fields in it. I need to display the values ​​of these fields in the visible part.

603ddfcc8fba8622227588.jpeg
I copied the component template, found the place where the data of the "Announcement" and "Details" fields are displayed, and did the same for my two fields (highlighted in red) - it did not help. Probably because they are not marked in any way.

603ddff41d888756272595.png
Then I opened the result_modifier.php file that comes with the template, found the definition of the variables "Announcement" and "Details" there and made two of my own by analogy (highlighted in red) - it did not help. Probably because the system does not know such a value (highlighted in green).

603de10203ae9762038838.png
The essence of the question is: "How do I add a display of my two added fields to the template?"

UPD #1
I make settings for the "Services" component, where my info block was displayed after it was created. When I rendered this component, it looks as I need, namely: A table of contents was created, buttons "up" were added after each entry, etc. You just need to add the output of these two fields.

603de9f14d044407233316.png
If I add an infoblock as a "News" component and specify the required infoblock in the data, then the info. output normally, but there are no tables of contents, no links, only "dry" information.

603dea4907c45124225835.png

Upd question: Wouldn't it be easier to change the template of the "News" component, instead of the one in which I currently have the setting?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Ryzhkin, 2021-03-02
@Franciz

The question is closed. It's easier to change the template of the "News" component.

V
Vitaliy Vayti, 2021-03-02
@vitvayti

Hello.
First of all, for all the properties that you want to display on the page, you need to enable the "Show on element detail page" option (this is enabled in the property settings).
After that, in the component settings, you may also need to select the properties that you want to display.
After that, they will be available in the $arResult["DISPLAY_PROPERTIES"] array

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question