Skip to content

Commit

Permalink
Docs: Add example of specifying custom company names #CCM-25
Browse files Browse the repository at this point in the history
  • Loading branch information
OndraM committed Nov 19, 2021
1 parent 06637bc commit 131eb34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ window.addEventListener('load', function () {
```

This will load the plugin from CDN and initialize the plugin with default settings.
[πŸ‘€ See example](https://lmc-eu.github.io/cookie-consent-manager/examples/).
[πŸ‘€ See example][examples].

## Use default web font, or not?

Expand Down Expand Up @@ -203,15 +203,15 @@ initLmcCookieConsentManager( // when loaded as a module, these options are passe
);
```
[πŸ‘€ See extended configuration example](https://lmc-eu.github.io/cookie-consent-manager/examples/configuration.html)
[πŸ‘€ See extended configuration example][examples-configuration]
## Configuration options
| Option | Type | Default value | Description |
|---------------|----------|--------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------|
| `defaultLang` | string | 'cs' | Default language. One of `cs`, `de`, `en`, `hu`, `pl`, `ru`, `sk`, `uk`. This language will be used when autodetect is disabled or when it fails. |
| `autodetectLang`| string | true | Autodetect language from the browser. If autodetect fails or if unsupported language is detected, fallback to `defaultLang`.<br>When disabled, force language to `defaultLang`. |
| `companyNames`| array | ['LMC'] | Array of strings with company names. Adjust only when the consent needs to be given to multiple companies. |
| `companyNames`| array | ['LMC'] | Array of strings with company names. Adjust only when the consent needs to be given to multiple companies. [See example][examples-configuration]. |
| `config` | Object | {} | Override default config of the underlying library. For all parameters see [original library](https://github.com/orestbida/cookieconsent#all-available-options). |
| `on*` callbacks| function | (cookie, cookieConsent) => {} | See below for configurable callbacks. |
Expand Down Expand Up @@ -240,7 +240,7 @@ Each configured callback receives two params:
| `onFirstAcceptOnlyNecessary`| Right after only necessary cookies are just accepted by the user |
| `onFirstAccept` | Right after any consent is just accepted by the user |
[πŸ‘€ See callbacks example](https://lmc-eu.github.io/cookie-consent-manager/examples/callbacks.html)
[πŸ‘€ See callbacks example][examples-callbacks]
## Theming
Expand Down Expand Up @@ -402,3 +402,6 @@ for more information.
[sass]: https://www.npmjs.com/package/sass
[sass load path]: https://sass-lang.com/documentation/cli/dart-sass#load-path
[sass modules]: https://sass-lang.com/blog/the-module-system-is-launched
[examples]: https://lmc-eu.github.io/cookie-consent-manager/examples/
[examples-callbacks]: https://lmc-eu.github.io/cookie-consent-manager/examples/callbacks.html
[examples-configuration]: https://lmc-eu.github.io/cookie-consent-manager/examples/configuration.html
1 change: 1 addition & 0 deletions examples/configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ <h3 class="mt-4">Use cookieConsent instance</h3>
{
autodetectLang: false, // do not detect language from the browser
defaultLang: 'en', // use 'en' language by default
companyNames: ['LMC', 'Some Other Company', 'ACME'], // define custom company names to be shown in the consent text
config: { // override default config of the underlying library, see https://github.com/orestbida/cookieconsent#all-available-options
delay: 500, // show cookie consent banner after 500ms
page_scripts: false, // disable third-party script management, see https://github.com/lmc-eu/cookie-consent-manager#third-party-scripts-loaded-via-script
Expand Down

0 comments on commit 131eb34

Please sign in to comment.