A
A
Alexander Meh2017-03-04 22:21:58
JavaScript
Alexander Meh, 2017-03-04 22:21:58

Yandex share for each picture in the gallery. Is it possible to???

There is a structure like this:

<div class="b-album">
                <div class="b-album__item">
                      <img class="b-album__img" src="' . $image['image'] . '" alt="' . $image['title'] . '">
                      <p class="b-album__title">' . $image['title'] . '</p>
                      <p class="b-album__price">' . $image['price'] . '</p>
                      <a href="#b-communications" class="b-album__link b-header__link">order</a>
                      <div class="ya-share2" id="i" data-services="vkontakte,facebook,odnoklassniki,gplus"></div>
                </div>



                <div class="b-album__item">
                      <img class="b-album__img" src="' . $image['image'] . '" alt="' . $image['title'] . '">
                      <p class="b-album__title">' . $image['title'] . '</p>
                      <p class="b-album__price">' . $image['price'] . '</p>
                      <a href="#b-communications" class="b-album__link b-header__link">order</a>
                      <div class="ya-share2" id="i" data-services="vkontakte,facebook,odnoklassniki,gplus"></div>
                </div>


                <div class="b-album__item">
                      <img class="b-album__img" src="' . $image['image'] . '" alt="' . $image['title'] . '">
                      <p class="b-album__title">' . $image['title'] . '</p>
                      <p class="b-album__price">' . $image['price'] . '</p>
                      <a href="#b-communications" class="b-album__link b-header__link">order</a>
                      <div class="ya-share2" id="i" data-services="vkontakte,facebook,odnoklassniki,gplus"></div>
                </div>

</div>

How to implement sharing for each block separately??? Now it picks up only OG tags (((!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ruslan, 2017-03-05
@mitrm

https://tech.yandex.ru/share/doc/dg/api-docpage/

Ya.share2('my-share', {
    content: {
        url: 'https://yandex.com',
        title: 'Yandex',
        description: 'It's all about Yandex',
        image: 'https://yastatic.net/morda-logo/i/logo.svg'   
    }
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question