Embedding Yandex.Market and Beru widgets


To place Yandex.Market and Beru widgets on a Turbo page:

  1. Generate the widget code. For more information, see Yandex.Market and Beru widgets in the Yandex.Market Help.
    Attention. Turbo pages don't support the searchSelector and searchImageSelector parameters.
  2. Add the generated code to the <![CDATA[]]> section inside the turbo:content element.
  3. To insert multiple widgets on a single page, add the desired number of script blocks. The method described in Inserting widgets into a site doesn't work.
<turbo:content>
    <![CDATA[
        ...
        <script type="text/javascript">
            (function (w) {
                function start() {
                w.removeEventListener("YaMarketAffiliateLoad", start);
                w.YaMarketAffiliate.createWidget({
                    containerId: "marketWidget1",
                    type: "offers",
                    params: {
                    clid: 2310490,
                    searchText: "Яндекс.Станция",
                    themeId: 2
                    }
                });
                }
                w.YaMarketAffiliate
                ? start()
                : w.addEventListener("YaMarketAffiliateLoad", start);
            })(window);
        </script>
        ...
    ]]>
</turbo:content>
Copied to clipboard