# GDPR Banner Documentation

## Overview

The GDPR (General Data Protection Regulation) banner is a component that displays cookie consent information to users visiting your website. This documentation explains how to customize the GDPR banner's template and translations.

## Template Customization

### Overriding the Template

You can override the default GDPR banner template through the configuration:

1. Navigate to your `config/packages/auto_admin_content.yaml` file
2. Add or modify the GDPR banner template path under the `auto_admin.content.templates.gdpr_banner` node:

```yaml
auto_admin:
    content:
        templates:
            gdpr_banner: 'your/custom/gdpr_banner.html.twig'
```

### Customizing the CNIL URL

By default, the GDPR banner uses the automatically generated GDPR page URL (`aa_content_path('page', {slugAdmin: 'gdpr'})`). You can override this default URL by setting the `cnilUrl` Twig variable.

This allows you to redirect users to a custom privacy policy page or any other GDPR information source of your choice.

## Frontend Integration

If you update AutoAdmin (AA) or override the GDPR banner styles, make sure to include the GDPR banner SCSS in your main `app.scss` file to ensure the banner displays correctly:

```scss
@import "../../../vendor/gda/autoadmin/assets/front/scss/gdpr_banner/gdpr_banner";
```

This import is required to compile the styles for the cookie banner during the asset build process.

## Translation Customization

The GDPR banner text can be customized through translation files:

1. Create or edit translation files named `gdpr_banner.{locale}.yaml` in your translation directory
2. Define the keys and translations you want to override

## Disabling GDPR Functionality

If needed, you can disable all GDPR processes on the frontend by adding the following line to your main JavaScript file (typically `assets/front/js/app.js`):

```javascript
document.body.aa_disable_gdpr = true;
```
