Adding content from the Odnoklassniki social network to a Turbo page

You can place embedded content from the Odnoklassniki network on Turbo pages:

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 Turbo pages → Debugging page in Yandex.Webmaster. More about debugging.

The “Class” (“Share”) button

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.
  1. Choose the source page of the site that the Turbo page is generated for and where you want to place the button. For example, https://example.com/page/.
  2. 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, title, description, image) {
            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.insertShareWidget(id,did,st, title, description, image);
                    }, 0);
                }
            }};
            d.documentElement.appendChild(js);
        }(document,"ok_shareWidget","https://ya.ru",'{"sz":30,"st":"oval","ck":1}',,,);
    </script>
    Short code of the widget call
    You have to create this code yourself:
    <script type="text/javascript">
        OK.CONNECT.insertShareWidget("mineShareWidgetDivId","https://ya.ru",'{"sz":30,"st":"oval","ck":1}',,,);
    </script>
  3. Add code to the <![CDATA[]]> tag inside the turbo:content element.
...
<turbo:content>
    <![CDATA[
        <script type="text/javascript">
           OK.CONNECT.insertShareWidget("mineShareWidgetDivId","https://ya.ru",'{"sz":30,"st":"oval","ck":1}',,,);
        </script>
    ]]>
</turbo:content>
...

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.
  1. 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 call
    You have to create this code yourself:
    <script type="text/javascript">
        OK.CONNECT.insertGroupWidget("widget", 48235937660955, '{width: "250", height: "285"}');
    </script>
  2. Add 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 HTML elements to embed videos on a Turbo page:
  • a (as a link). In this case, the video will open on top of the Turbo page contents.
  • iframe.

Add code to the <![CDATA[]]> tag inside the turbo:content element.

...
<turbo:content>
    <![CDATA[
        <a href="https://ok.ru/video/771913157349"/a>
    ]]>
</turbo:content>
...