twin-elements/gdpr-cookies-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

twin-elements/gdpr-cookies-bundle

最新稳定版本:v2.0.1

Composer 安装命令:

composer require twin-elements/gdpr-cookies-bundle

包简介

GDPR cookies for CMS

README 文档

README

1.Install

composer require twin-elements/gdpr-cookies-bundle

2.in routing.yaml file

gdpr_cookies:
    resource: "@TwinElementsGDPRCookiesBundle/Controller/"
    prefix: /
    type: annotation
    requirements:
        _locale: '%app_locales%'
    defaults:
        _locale: '%locale%'
        _admin_locale: '%admin_locale%'
    options: { i18n: false }

3.In bundles.php file

TwinElements\GDPRCookiesBundle\TwinElementsGDPRCookiesBundle::class => ['all' => true],
  1. Configuration If you have created route "cookies_policy" leave package settings (config/packages/twin_elements_gdpr_cookies.yaml) unchanged
twin_elements_gdpr_cookies: ~

If you want to change the default route to your own, enter it in the package configuration

twin_elements_gdpr_cookies:
    cookies_policy_route: your_route_name

in webpack.config.js create alias for root dir:

const rootDir = path.resolve(__dirname, '');

Encore
    .setOutputPath('public/build/')
    .setPublicPath('/build')
    .addEntry('common', './assets/js/app.js')
;

const frontConfig = Encore.getWebpackConfig();
frontConfig.resolve.alias['root-dir'] = rootDir;
frontConfig.name = 'frontConfig';

Encore.reset();

Import cookies.js

import 'root-dir/public/bundles/twinelementsgdprcookies/js/cookies';

##How it use?

For marketing codes

{% if isMarketingAccepted() %}{% endif %}

Form analytics codes

{% if isAnalyticsAccepted() %}{% endif %}

In base template add

<div id="cookies-base-container"></div>

To overwrite translations, create a cookies.LOCALE.yaml file and enter your own translations

统计信息

  • 总下载量: 190
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-10-01