Answer the question
In order to leave comments, you need to log in
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.
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.
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).
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.
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.
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
The question is closed. It's easier to change the template of the "News" component.
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 questionAsk a Question
731 491 924 answers to any question