B
B
barder2020-08-02 17:04:31
Yandex
barder, 2020-08-02 17:04:31

Has anyone made share buttons on social networks on a Bitrix website?

Good day.

There is news that has the following properties:
"Orientation to repost" - REPOST - file property.
"Signs" - PRIMETY - text property

In general, I decided to connect Share the Yandex block.
on the detailed page in the template I output:

<? $URLRepost = CFile::GetPath($arResult["PROPERTIES"]["REPOST"]);?>
Поделиться в соцсетях:
<script src="https://yastatic.net/es5-shims/0.0.2/es5-shims.min.js"></script>
<script src="https://yastatic.net/share2/share.js"></script>
<div class="ya-share2" data-description="<?=$arResult['PROPERTIES']['PRIMETY']["VALUE"]['TEXT'];?>" data-services="vkontakte,facebook,odnoklassniki,whatsapp" data-title="<?=$x?>" data-access-token:facebook="fb-token" data-image="<?=$URLRepost;?>"></div>
</div>

but only "data-title" works,
data-image and data-description don't work.
If you print print_r($arResult['PROPERTIES']['PRIMETY']["VALUE"]['TEXT']) and print_r($URLRepost) it displays normally on the page, but does not accept

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
scottparker, 2020-08-02
@scottparker

the cant is in quotes of the data-description attribute

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question