A
A
alexander_chn2018-02-23 18:39:02
1C-Bitrix
alexander_chn, 2018-02-23 18:39:02

How to display XML_ID properties of list type in Bitrix?

Hello!
The infoblock has a property of the list type. It has several meanings. prntscr.com/iirxcs
Here is the code to display the value

<?
CModule::IncludeModule("iblock");
$iblock_id = 31;
$return_str = "";
$arSelect = Array( 
  "ID",
  "NAME",
  "PROPERTY_ATT_CMP_PODDOMEN",
  "PROPERTY_ATT_CMP_SERV",	
  "PROPERTY_ATT_CMP_TYPE",
  "PROPERTY_ATT_CMP_ADV"
);
$arFilter = Array( "IBLOCK_ID"=>$iblock_id, "ACTIVE_DATE"=>"Y", "ACTIVE"=>"Y" );
$res = CIBlockElement::GetList(Array("SORT"=>"ASC"), $arFilter, false, false, $arSelect);
while($ob = $res->GetNextElement()) {
    $arFields = $ob->GetFields();
    $return_str .= $arFields["PROPERTY_ATT_CMP_PODDOMEN_VALUE"] . "<hr>";
    $return_str .= htmlspecialchars_decode($arFields["PROPERTY_ATT_CMP_SERV_VALUE"]["TEXT"]) . "<hr>";
    $return_str .= htmlspecialchars_decode($arFields["PROPERTY_ATT_CMP_TYPE_VALUE"]["TEXT"]) . "<hr>";
    $return_str .= htmlspecialchars_decode($arFields["PROPERTY_ATT_CMP_ADV_VALUE"]["TEXT"]) . "<hr>";
}
echo $return_str;
?>

And how can I display XML_ID: balashiha, vidnoe, etc. ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Epifanov, 2018-02-23
@alexander_chn

Using CIBlockElement::GetList will not work. Take advantage of this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question