V
V
viktorulyushev2017-01-20 10:02:47
1C-Bitrix
viktorulyushev, 2017-01-20 10:02:47

Bitrix. How to display DISPLAY_VALUE?

In general, I have a property in the element binding to the element, when I link a doctor to a clinic, this doctor is displayed on the clinic page, but how can I make the link to the clinic to which he is linked appear on the page of the doctor himself?
print_r($arResult);
gives this

[EMPLOYER] => Array
                (
                    [ID] => 74
                    [TIMESTAMP_X] => 2017-01-19 16:41:29
                    [IBLOCK_ID] => 13
                    [NAME] => Место работы
                    [ACTIVE] => Y
                    [SORT] => 500
                    [CODE] => EMPLOYER
                    [DEFAULT_VALUE] => 
                    [PROPERTY_TYPE] => E
                    [ROW_COUNT] => 1
                    [COL_COUNT] => 30
                    [LIST_TYPE] => L
                    [MULTIPLE] => N
                    [XML_ID] => 
                    [FILE_TYPE] => 
                    [MULTIPLE_CNT] => 5
                    [TMP_ID] => 
                    [LINK_IBLOCK_ID] => 13
                    [WITH_DESCRIPTION] => N
                    [SEARCHABLE] => N
                    [FILTRABLE] => N
                    [IS_REQUIRED] => N
                    [VERSION] => 1
                    [USER_TYPE] => 
                    [USER_TYPE_SETTINGS] => 
                    [HINT] => 
                    [PROPERTY_VALUE_ID] => 6427
                    [VALUE] => 199
                    [DESCRIPTION] => 
                    [VALUE_ENUM] => 
                    [VALUE_XML_ID] => 
                    [VALUE_SORT] => 
                    [~VALUE] => 199
                    [~DESCRIPTION] => 
                    [~NAME] => Место работы
                    [~DEFAULT_VALUE] => 
                    [DISPLAY_VALUE] => 
                    <a href="/clinics/chastnye/amikoestetik/">АмикоЭстетик</a>

                    [LINK_ELEMENT_VALUE] =&gt; Array
                        (
                            [199] =&gt; Array
                                (
                                    [ID] =&gt; 199
                                    [~ID] =&gt; 199
                                    [IBLOCK_ID] =&gt; 13
                                    [~IBLOCK_ID] =&gt; 13
                                    [NAME] =&gt; АмикоЭстетик
                                    [~NAME] =&gt; АмикоЭстетик
                                    [DETAIL_PAGE_URL] =&gt; /clinics/chastnye/amikoestetik/
                                    [~DETAIL_PAGE_URL] =&gt; /clinics/chastnye/amikoestetik/
                                    [PREVIEW_PICTURE] =&gt; 
                                    [~PREVIEW_PICTURE] =&gt; 
                                    [DETAIL_PICTURE] =&gt; 
                                    [~DETAIL_PICTURE] =&gt; 
                                    [LANG_DIR] =&gt; /
                                    [~LANG_DIR] =&gt; /
                                    [CODE] =&gt; amikoestetik
                                    [~CODE] =&gt; amikoestetik
                                    [EXTERNAL_ID] =&gt; 199
                                    [~EXTERNAL_ID] =&gt; 199
                                    [IBLOCK_SECTION_ID] =&gt; 37
                                    [~IBLOCK_SECTION_ID] =&gt; 37
                                    [IBLOCK_TYPE_ID] =&gt; catalog
                                    [~IBLOCK_TYPE_ID] =&gt; catalog
                                    [IBLOCK_CODE] =&gt; clinics
                                    [~IBLOCK_CODE] =&gt; clinics
                                    [IBLOCK_EXTERNAL_ID] =&gt; 
                                    [~IBLOCK_EXTERNAL_ID] =&gt; 
                                    [LID] =&gt; s1
                                    [~LID] =&gt; s1
                                )

                        )

                )

i.e. he even enters the link as I need, but how can I display it in the code?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey, 2017-01-20
@gangstarcj

<?=$['EMPLOYER']['DISPLAY_VALUE']?>

V
viktorulyushev, 2017-01-20
@viktorulyushev

Brought it out like this
but I don't think that's the correct answer, is it?

S
Stalker_RED, 2017-07-27
@Stalker_RED

1. У вас большинство функций обернуты в само-вызываемые (self-invoking) выражения
Обычно это специально делается, чтоб снаружи к этой функции было сложнее достучаться. Вам придется либо разобраться зачем это сделано, и можно ли пересмотреть использование такого подхода, либо нагородить кучу костылей.
2. Скорее всего в процессе работы что-то идет не так, и в какой-то момент происходит попытка прочитать значение element.files[0] у элемента, у которого вообще нет .files. Проще всего посмотреть в отладчике, который встроен в DevTools браузера.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question