Adding content from the Odnoklassniki social network to a Turbo page
You can place embedded content from the Odnoklassniki network on Turbo pages:
- The “Class” (“Share”) button. Allows the users to mark Turbo page content and share it in Odnoklassniki.
- The group widget. Helps users join your group quickly.
- Video. Lets you add videos posted in Odnoklassniki to the text.
After adding the embed code to the RSS feed, check how the content is displayed on the Turbo page. You can do this on the More about debugging.
page in Yandex.Webmaster.The group widget
You can add several embedded blocks to one Turbo page. To do this, use the code sample provided in the Odnoklassniki instructions.
Attention. Turbo pages don't support JavaScript code for tracking events.
- In Odnoklassniki, configure the widget display and generate the embed code.
Copy the script element and its contents from the embed code. You can use the following code variations:
Full code of the API and widget call<script> !function (d, id, did, st) { var js = d.createElement("script"); js.src = "https://connect.ok.ru/connect.js"; js.onload = js.onreadystatechange = function () { if (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") { if (!this.executed) { this.executed = true; setTimeout(function () { OK.CONNECT.insertGroupWidget(id,did,st); }, 0); } }} d.documentElement.appendChild(js); }(document,"ok_group_widget","48235937660955",'{"width":250,"height":285}'); </script>
Short code of the widget callYou have to create this code yourself:<script type="text/javascript"> OK.CONNECT.insertGroupWidget("widget", 48235937660955, '{width: "250", height: "285"}'); </script>
- Add the embed code to the <![CDATA[]]> tag inside the turbo:content element.
...
<turbo:content>
<![CDATA[
<script type="text/javascript">
OK.CONNECT.insertGroupWidget("widget", 48235937660955, '{width: "250", height: "285"}');
</script>
]]>
</turbo:content>
...
Video
Use the HTML elements to embed video clips on a Turbo page:
- a (as a link). In this case, the video will open on top of the Turbo page contents.
- iframe.
Add the embed code to the <![CDATA[]]> tag inside the turbo:content element.
...
<turbo:content>
<![CDATA[
<a href="https://ok.ru/video/771913157349"/a>
]]>
</turbo:content>
...
...
<turbo:content>
<![CDATA[
<iframe width="560" height="315" src="//ok.ru/videoembed/771913157349" frameborder="0" allow="autoplay" allowfullscreen></iframe>
]]>
</turbo:content>
...
Note.
When setting up the widget, configure links to open in a new tab (target="_blank"
), otherwise there is a risk that the user won't be able to open the link.