G
G
Gregory Didus2015-04-13 18:01:33
MODX
Gregory Didus, 2015-04-13 18:01:33

How to put social media like buttons on home page?

Good day!
1. There is a task: to display a list of news on the main page, and under each annotation of the news, you need to put like buttons vk, facebook, twitter.
2. The same buttons should be at the bottom of the news itself when we read it.
170f71ccc12e462791a37343d18539c8.jpg
I have dealt with point 2. The identifier for a like is the page id. I use Modx Revo. Here is an example on the VK button

<!-- vk -->	
    <script type="text/javascript">
        VK.init({apiId: 4874657, onlyWidgets: true});
    </script>

    <div class="vkontakte" id=""></div>
    <script type="text/javascript">
        VK.Widgets.Like("", {type: "mini"});
    </script>
    <!-- vk -->

Everything is clear here, the button takes the id from the page on which it is located.
And what about the main page? After all, it has a lot of links to articles under which these buttons should be. And the id of this page is 1 for all.
95ef7402d87b4b9ebf2025b24b0116b4.jpg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zooks, 2015-04-13
@zooks

You need to paste the code into the newsfeed output template.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question