Answer the question
In order to leave comments, you need to log in
Bitrix display property bound to element?
Hi Everyone, you need to display the property attached to the element, in my case, the id to which the element is attached is displayed. The question is how to display the values of the property itself and not the value of the element to which it is attached?
here is the code
if ($arFields['IBLOCK_ID'] == 9) {
$ID = $arFields['ID'];
$arSelect = Array("PROPERTY_DATETIME", "PROPERTY_USER", "PROPERTY_CLINIC", "PROPERTY_DOCTORS");
$arFilter = Array("IBLOCK_ID"=>9, "ACTIVE_DATE"=>"Y", "ACTIVE"=>"Y", "ID" => $ID);
$res = CIBlockElement::GetList(Array(), $arFilter, false, false, $arSelect);
if ($res->SelectedRowsCount() == 1) {
if ($GLOBALS['compare']["ID"] == $ID) {
while($ob = $res->Fetch()){
// Получаем новую дату
$date_time = $ob['PROPERTY_DATETIME_VALUE'];
$clinic = $ob['PROPERTY_CLINIC_VALUE'];
//вот тут выводится не само свойствао а id привязанного
$doctors = $ob['PROPERTY_DOCTORS_VALUE'];
$user = getUserLoginById($ob['PROPERTY_USER_VALUE']);
$user_lang = getUserLangById($ob['PROPERTY_USER_VALUE']);
$user_id = $ob['PROPERTY_USER_VALUE'];
}
}
}
}
Answer the question
In order to leave comments, you need to log in
Instead of Fetch in line
Use GetNextElement
To get the fields do this
To get the properties do this
This is inside the while loop.
You can read more here
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question