neosrulez / cookieoptin
本包最新版本(2.0.9)没有提供许可信息。
一个处理Neos CMS Cookie Opt-In的包。
2.0.9
2024-06-03 06:33 UTC
Requires
- neos/neos: ^7.0 || ^8.0 || ^8.1
README
一个处理Neos CMS Cookie Opt-In的包。
安装
NeosRulez.CookieOptIn 包已列在 Packagist 上(https://packagist.org.cn/packages/neosrulez/cookieoptin),因此您无需再将其包含在 "repositories" 条目中。
只需运行
composer require neosrulez/cookieoptin
用法
json 文件中所有必要语言中使用的 cookie 定义。
NeosRulez: CookieOptIn: metadataPathAndFilename: 'resource://NeosRulez.CookieOptIn/Private/Metadata/{lang}.cookie.json' bannerDelayTime: 2000
Neos 方面
在 iframe 标签中定义 data-attributes (data-cookie)
,并在 script 标签中额外定义 type="text/plain"
。使用 Fusion 很简单。
<iframe data-cookie="bar" width="1116" height="628" cookie-src="https://www.youtube.com/embed/7KUdmFyefSA" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> <script data-cookie="all" type="text/plain" async src="https://#/gtag/js?id=UA-141147524-30"></script> <script data-cookie="all" type="text/plain">window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag("js", new Date());gtag("config", "UA-141147524-30");</script>