E
E
Elios2014-11-14 12:28:29
1C-Bitrix
Elios, 2014-11-14 12:28:29

How to transfer a property from an infoblock (Bitrix) to a modal window (fancybox)?

Guys, tell me how to transfer the property (a) of the infoblock to the modal (pop-up) window? This property is of type file(image). I did something like this.

<div class="look_plan"><a  class="fancybox" href="<? echo $arResult['DISPLAY_PROPERTIES']['PLAN_IMGS']['DISPLAY_VALUE'];?>"><p>Посмотреть планировку</p></a></div>

A window pops up, but there is a download link in it, by clicking on which the picture opens in a new window.
Can anyone come across?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
E
Elios, 2014-11-14
@Elios

Maybe someone will come in handy. I did so

<?$plan = CFile::GetPath($arResult["PROPERTIES"]["PLAN_IMGS"]["VALUE"]);?><img src="<?echo $plan;?>" />

T
Tashiro, 2014-11-14
@Tashiro

DISPLAY_VALUE - this is exactly the link and you will
need to use $arResult['PROPERTIES']['PLAN_IMGS']['VALUE'] if it is multiple, then it will be an array of file IDs, if not, respectively - a string with ID, you need to get the src of the picture via CFile: :GetByID
study:
dev.1c-bitrix.ru/api_help/main/reference/cfile/ind... I
advise you to do this not in the template, but in result_modifier.php

R
Rad1calDreamer, 2014-11-14
@Rad1calDreamer

property(s) of the infoblock

exactly? and not a property of the infoblock element?
$arResult than at you is formed? component or via API? this will depend on the answer to your question.

A
asd111, 2014-11-14
@asd111

Is everything ok with the layout? The Fancybox website has this example:

<a id="example1" href="http://farm5.static.flickr.com/4058/4252054277_f0fa91e026.jpg">
   <img alt="example1" src="http://farm5.static.flickr.com/4058/4252054277_f0fa91e026_m.jpg">
</a>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question