Code Monkey home page Code Monkey logo

volto-cookie-banner's Introduction

volto-cookie-banner

Volto cookie banner integration addon.

To be used with: collective.volto.cookieconsent

To be used with mrs-developer, see Volto docs for further usage informations.

Usage

If you're using Volto < 12, then use v1.0.2

Wherever you want to add the component, import and use it like this:

import CookieBanner from 'volto-cookie-banner/CookieBannerContainer';

const YourAppComponent = () => <CookieBanner />;

A suggested way is to use appExtras from settings object:

export const settings = {
  ...defaultSettings,
  appExtras: [
    ...defaultSettings.appExtras,
    {
      match: '',
      component: CookieBanner,
    },
  ],
};

Add a widget for the controlpanel

Without any other customization, in the controlpanel you'll find a text area which will accept a json object. This is the job for volto-multilingual-widget.

import { MultilingualWidget } from 'volto-multilingual-widget';

export const widgets = {
  ...defaultWidgets,
  id: {
    ...defaultWidgets.id,
    cookie_consent_configuration: MultilingualWidget(),
  },
};

Styling

If you want to change or adapt styles, you should start adapting volto-cookie-banner.css and react-cookie-consent styling docs.

Translations

This product has been translated into:

  • Italian
  • English

Please, contribute to this project adding translations for your language.

volto-cookie-banner's People

Contributors

giuliaghisini avatar nzambello avatar tiberiuichim avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

volto-cookie-banner's Issues

Cannot find module 'volto-cookie-banner/CookieBannerContainer

I am trying to use CookieBanner with plone 6 + latest Volto. Using v2.1.0

import CookieBanner from 'volto-cookie-banner/CookieBannerContainer';
...
config.settings = {
    ...config.settings,
    isMultilingual: false,
    supportedLanguages: ['en'],
    defaultLanguage: 'en',
    appExtras: [
        ...config.settings.appExtras,
        {
            match: '',
            component: CookieBanner
        },
    ]
};

Error:

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.