# AyalineEzMiniSitesCollectivitesBundle

AyalineEzMiniSitesCollectivitesBundle permet d'installer des mini-sites

## Installation

1. a partir du composer, ajouter:

// composer.json

    {
        "require": {
            "ayaline/ez-mini-sites-collectivite-bundle":"1.0.*"
        }
    }

2. Ensuite, activez-le dans votre EzPublishKernel.php:

// app/AppKernel.php

    public function registerBundles()
    {
        $bundles = array(
            //...
            new Ayaline\Bundle\EzMiniSitesCollectivitesBundle\AyalineEzMiniSitesCollectivitesBundle(),
            //...
    }
    
    
3.  Intégrer les classes de contenu :  (cf. package eZ dans Ressources/doc).
4.  Créer l'arboressence du mini-site

## Configuration

// ezpublish/config/ezpublish.yml

Ajouter la config du nouveau siteaccess (Exemple)
    
    siteaccess:
        # Available siteaccesses
        default_siteaccess: ayaline
        list:
            - ayaline
            - ayaline_admin
            - ayaline_theatre_de_l_ardaillon
        groups:
            ayaline_group:
                - ayaline
                - ayaline_admin
                - ayaline_theatre_de_l_ardaillon
        match:
            Map\Host:
                %host_siteaccess_ayaline%: ayaline
                %host_siteaccess_ayaline_admin%: ayaline_admin
                %host_siteaccess_ayaline_theatre_de_l_ardaillon%: ayaline_theatre_de_l_ardaillon
                
    .....
    
    system:
            .....
        ayaline_theatre_de_l_ardaillon:
                legacy_mode: false
                languages:
                    - fre-FR
                session:
                    name: eZSESSID
                content:
                    tree_root:
                        location_id: %siteaccess.ayaline_theatre_de_l_ardaillon_location_id%

// ezpublish/config/parameters.yml

Ajouter les paramètres (Exemple)

    host_siteaccess_ayaline_theatre_de_l_ardaillon: dev.theatre_de_l_ardaillon.local
    
    ezpublish_legacy.ayaline_theatre_de_l_ardaillon.view_default_layout: 'AyalineEzMiniSitesCollectivitesBundle::pagelayout.html.twig'
    ezpublish_legacy.ayaline_theatre_de_l_ardaillon.module_default_layout: 'AyalineEzMiniSitesCollectivitesBundle::pagelayout_legacy.html.twig'

    siteaccess.ayaline.location_id: 65
    siteaccess.ayaline_theatre_de_l_ardaillon_location_id: 2295

    identifier.config_general.ayaline: configuration_generale
    identifier.config_general.ayaline_theatre_de_l_ardaillon: configuration_generale_minisite

// ezpublish/config/routing.yml

    ayaline_agenda:
        resource: "@AyalineEzMiniSitesCollectivitesBundle/Resources/config/routing.yml"
        prefix:   /
        
// ezpublish/config/override.yml

    Créer les mêmes override existants pour le nouveau site-access (mini-sites)
                        
5.  Surcharger head_style/page_head_style_siteaccess-name.html.twig en changeant le nom du fichier avec le bon nom du mini-site
    
// ezpublish/Resources/AyalineEzMiniSitesCollectivitesBundle/views/head_style/page_head_style_ayaline_theatre_de_l_ardaillon.html.twig

6.  Configuration ezpublish_legacy (Cf projet Vias)
 