V
V
ViktorGuerro2020-10-29 09:58:39
1C-Bitrix
ViktorGuerro, 2020-10-29 09:58:39

How to display the property of the infoblock in the form of html code in 1C Bitrix?

I'm trying to display a video review through the properties of the infoblock element. I got to the point that a custom property is set on the element. The problem is that when I write:

<div><?=$arItem['PROPERTIES']['youtube']['VALUE']['TEXT']?></div>

The text is displayed:
<iframe width="560" height="315" src="https://www.youtube.com/embed/123456" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Property structure:
array(2) {
["TEXT"]=> string(281) "
<iframe width="560" height="315" src="https://www.youtube.com/embed/123456" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
"
["TYPE"]=> string(4) "HTML"
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
PetrPo, 2020-10-29
@ViktorGuerro

Put a tilde before VALUE ~

<div><?=$arItem['PROPERTIES']['youtube']['~VALUE']['TEXT']?></div>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question