N
N
Nadezhda Golovina2020-10-14 17:25:35
1C-Bitrix
Nadezhda Golovina, 2020-10-14 17:25:35

How to display the properties of an element through "Element Binding"?

Hello.
There is an element ( Product card ). It is necessary to display the properties (Address, Phone, etc.) from another element ( Brand Salon ) in it. Added the "Binding to elements" property to the infoblock of the Product card. In the admin panel, a field for the ID of the Brand Salons infoblock has appeared. And how to further display the desired properties from another element?
Tried:

<div class="salon-place">
      <ul>
      <?foreach($arResult["PROPERTIES"]["PLACE"]["VALUE"] as $idel):?>
      <?$obj = CIBlockElement::GetByID($idel);?>
      <?if($objres = $obj->GetNext())?>
      <li><a href='<?=$objres["DETAIL_PAGE_URL"];?>'><?=$objres["NAME"];?></a></li>
      <?endforeach;?>
      </ul>
      </div>
It didn't work out.
How else can you do it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
scottparker, 2020-10-14
@scottparker

in the result_modifier.php file of the template where you want to output, make a request by the id of the attached element and save the data somewhere in $arResult

Y
Yaroslav Alexandrov, 2020-10-15
@alexyarik

It is necessary to display properties in it (Address, Phone

To get property values ​​additionally, you need to add CIBlockElement::GetProperty
https://dev.1c-bitrix.ru/api_help/iblock/classes/c... to your code

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question