U
U
UnderDog322020-09-09 13:31:22
1C-Bitrix
UnderDog32, 2020-09-09 13:31:22

How to properly display UF-property in Bitrix?

Good afternoon!

The section with ID 65 has a custom property UF_KRATKO.

First, I get $ar_res by ID:

$res = CIBlockSection::GetByID(65); $ar_res=$res->GetNext();


I deduce a field "description": Everything is deduced safely. I'm trying to display a custom property: I 'm trying again like this: Nothing is displayed. I can't figure out where is the error?

<?=$ar_res['DESCRIPTION']?>


<?=$ar_res['UF_KRATKO']?>


<?=$ar_res['~UF_KRATKO']?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
PetrPo, 2020-09-09
@UnderDog32

The problem is that the documentation must be carefully read, it is written that this method

Returns a CIBlockResult object. Custom fields are not returned .

Use GetList .
Pay attention
to display custom properties, IBLOCK_ID must be passed and the code of the required properties UF_XXX must be passed to arSelect. If you need to display all user properties, then UF_* must be passed to arSelect.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question