Download the PHP package la-haute-societe/craft-tarteaucitron without Composer

On this page you can find all versions of the php package la-haute-societe/craft-tarteaucitron. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package craft-tarteaucitron

Craft 4 - tarteaucitron.js

Handle GDPR in your Craft CMS projet the easy way with tarteaucitron.js.

This plugin currently support the following services :

Requirements

This plugin requires Craft CMS 4.0.0 or later. Version 2.x of this plugin supports Craft CMS 3.x

Installation

The easy way

Just install the plugin from the Craft Plugin Store.

From the command line

`

Tarteaucitron plugin Overview

tarteaucitron.js is a javascript library allowing you to handle GDPR compliance on your site. It allows end-users to give their consent before exposing them to third party services (such as Google, Facebook, Twitter…).

This plugin makes the integrating tarteaucitron.js in Craft CMS projects a breeze.

Using the Tarteaucitron plugin

Initialization script

Add the following twig code in the templates where you want the plugin to be loaded (in the <head> section of the layout page for example):

`

Loading services

The plugin and its associated services are configurable from the plugin settings page.

To activate a service on your site, you need to activate it and then, depending on the service, add the given Twig code where you want the service to be loaded. The Twig code will output a tarteaucitron.js placeholder, that will get replaced by the content you wanted to load (e.g. a YouTube video, a Google Maps…) once tarteaucitron.js has loaded, and the user has given its consent for the service.

Service HTML Attributes

For some service templates, you can include a parameter named htmlAttributes. This parameter allows you to define html attributes for the html tag associated with the service.

Example :

`

Advanced usage

Manually instantiating services

If for some reason, you'd rather not use the craft.tarteaucitron.xxx() methods to instantiate your services, you can always add the tarteaucitron.js placeholder element by yourself.

These two examples will have the exact same result (you still need to enable the Vimeo service in the plugin settings):

`

`

Checking if a service is enabled

You may need to check whether a service is enabled (as in "enabled in the plugin settings", this has nothing to do with whether the user has given its consent):

`

Here are the available isXXXEnabled() methods:

JS - Dynamically adding elements managed by a service

Sometimes you need to dynamically add an element that should be managed by tarteaucitron.js (eg. you load a page fragment containing a Vimeo video using AJAX). Adding the tarteaucitron.js placeholder to the DOM isn't enough. You need to ask tarteaucitron.js to re-render the service :

`

JS - Reacting to the user giving its consent to a service

Unfortunately, there is no clean way to do this at the moment, but a PR will be submitted to try to improve tarteaucitron.js.

Customizing JS output in the page

Instead of using {{ craft.tarteaucitron.initScript() }} to output both the tarteaucitron.js tag and the configuration JS tag, use:

Customizing CSS output

By default, tarteaucitron.js imports the css/tarteaucitron.css stylesheet located next to the tarteaucitron.js file. You can prevent this using the useCustomCss setting of the plugin. You can provide your own stylesheet or use {{ craft.tarteaucitron.stylesheetTag() }} to output the tarteaucitron.js stylesheet import tag

Contribute

Want to contribute? See CONTRIBUTING.md

Brought to you by


All versions of craft-tarteaucitron with dependencies

PHP Build Version
Package Version
Requires craftcms/cms Version ^4.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package la-haute-societe/craft-tarteaucitron contains the following files

Loading the files please wait ....