Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I need to block embedded YouTube videos unless Marketing cookies have been accepted by the user. Our site uses Umbraco as CMS, which means most, though not all, videos are being embedded through the Umbraco backoffice.
I've been following this guide: https://support.cookiebot.com/hc/en-us/articles/360003790854-Iframe-cookie-consent-with-YouTube-example
This works fine for already implemented iframes in the code, but I'm not sure how to make this work for Umbraco video embeds.
I found a question similar to mine here: https://our.umbraco.com/forum/using-umbraco-and-getting-started/105092-gridlayout-embed-with-cookiebot
In my default embed view at Views/Partials/Grid/Embed.cshtml, i now have the following code:
@model dynamic @using Umbraco.Web.Templates @{ string embedValue = Convert.ToString(Model.value); embedValue = embedValue.DetectIsJson() ? Model.value.preview : Model.value; embedValue = embedValue.Replace(" src=", "data-cookieconsent=\"marketing\" data-src="); } <div class="video-wrapper"> @Html.Raw(Model.value) </div>
My question is how this would work for all existing embeds on the site? What would be the best way of testing this?
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Blocked embedded YouTube videos unless Marketing cookies have been accepted in Umbraco
I need to block embedded YouTube videos unless Marketing cookies have been accepted by the user. Our site uses Umbraco as CMS, which means most, though not all, videos are being embedded through the Umbraco backoffice.
I've been following this guide: https://support.cookiebot.com/hc/en-us/articles/360003790854-Iframe-cookie-consent-with-YouTube-example
This works fine for already implemented iframes in the code, but I'm not sure how to make this work for Umbraco video embeds.
I found a question similar to mine here: https://our.umbraco.com/forum/using-umbraco-and-getting-started/105092-gridlayout-embed-with-cookiebot
In my default embed view at Views/Partials/Grid/Embed.cshtml, i now have the following code:
My question is how this would work for all existing embeds on the site? What would be the best way of testing this?
is working on a reply...