Navigation

Contactez-nous

Kitpages
155 cours Berriat
38000 Grenoble
tel : 04 76 70 93 03

Dernière mise à jour : 26 avril 2012

Installation du CMS Kitpages

Installation simplifiée

Pour installer le CMS Kitpages, nous vous conseillons de partir de la distribution symfony du CMS Kitpages : https://github.com/kitpages/symfony-kitpages-cms-edition

Installation complète : Attention : plus à jour

Nous fournissons ci-dessous une méthode d'installation, mais elle n'est plus vraiment à jour.

Nous essaierons de la mettre à jour rapidement, mais nous vous conseillons fortement de partir de l'installation simplifiée.

 

Doc d'installation (obsolète)

Je recopie ici la documentation du bundle.

KitpagesCmsBundle Installation
==============================
This page describes the installation procedure to integrate the Kitpages CMS Bundle in an existing website

Download all the source code
----------------------------

::

    wget http://symfony.com/download?v=Symfony_Standard_2.0.1.tgz
    tar zxvf Symfony_Standard_2.0.1.tgz
    cd Symfony


Edit deps file
--------------

::

    [KitpagesSimpleCacheBundle]
        git=http://github.com/kitpages/KitpagesSimpleCacheBundle.git
        target=Kitpages/SimpleCacheBundle

    [KitpagesUtilBundle]
        git=http://github.com/kitpages/KitpagesUtilBundle.git
        target=Kitpages/UtilBundle

    [KitpagesCmsBundle]
        git=http://github.com/kitpages/KitpagesCmsBundle.git
        target=Kitpages/CmsBundle

    [KitpagesFileBundle]
        git=http://github.com/kitpages/KitpagesFileBundle.git
        target=Kitpages/FileBundle

    [DoctrineExtensions]
        git=http://github.com/l3pp4rd/DoctrineExtensions.git
        target=/gedmo-doctrine-extensions

    [DoctrineExtensionsBundle]
        git=http://github.com/stof/StofDoctrineExtensionsBundle.git
        target=/bundles/Stof/DoctrineExtensionsBundle

    [DoctrineFixturesBundle]
        git=http://github.com/symfony/DoctrineFixturesBundle.git
        target=/bundles/Symfony/Bundle/DoctrineFixturesBundle

    [DataFixturesBundle]
        git=http://github.com/doctrine/data-fixtures.git
        target=/bundles/DataFixtures/DataFixturesBundle

run the vendors re-install
--------------------------

::

    ./bin/vendors install --reinstall


Change configuration
--------------------

In the app/AppKernel.php add
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

::

    new Kitpages\CmsBundle\KitpagesCmsBundle(),
    new Kitpages\FileBundle\KitpagesFileBundle(),
    new Kitpages\SimpleCacheBundle\KitpagesSimpleCacheBundle(),
    new Kitpages\UtilBundle\KitpagesUtilBundle(),
    new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
    new Symfony\Bundle\DoctrineFixturesBundle\DoctrineFixturesBundle(),


In the app/autoload.php add the line
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

::

    'Kitpages'         => __DIR__.'/../vendor',
    'Doctrine\\Common\\DataFixtures' => __DIR__.'/../vendor/bundles/DataFixtures/DataFixturesBundle/lib',
    'Stof'             => __DIR__.'/../vendor/bundles',
    'Gedmo'            => __DIR__.'/../vendor/gedmo-doctrine-extensions/lib',


Edit app/config/parameters.ini, put your confs and add a new conf
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

::

    base_url          = http://www.mywebsite.fr


Edit the app/config/config.yml
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

in twig section add the following

::

    twig:
        debug:            %kernel.debug%
        strict_variables: %kernel.debug%
        globals:
            cms:
                type: service
                id: kitpages.cms.model.cmsManager

add the following sections

::

    stof_doctrine_extensions:
        default_locale: en_US
        orm:
            default:
                timestampable: true # not needed: listeners are enabled by default
                sortable: true
                sluggable: true
                tree: true

    kitpages_cms:
        block:
            template:
                template_list:
                    standard:
                        class: '\Kitpages\CmsBundle\Form\Block\StandardForm'
                        name: "Standard"
                        twig: "KitpagesCmsBundle:Block:form/standard.html.twig"
            renderer:
                standard:
                    default:
                        type: "twig"
                        twig: "KitpagesCmsBundle:Block:renderer/standard/default.html.twig"
        page:
            renderer_twig_main: "KitpagesCmsBundle:Page:layout.html.twig" # optional default:"KitpagesCmsBundle:Page:layout.html.twig"
            data_inheritance_list: ["backgroundColor", "author"] # optional
            data_inheritance_form_class: "\App\SiteBundle\Form\\Page\DataInheritance" # optional
            data_inheritance_form_twig: "AppSiteBundle:Page:form/data-inheritance.html.twig" # optional
            layout_list:
                default:
                    renderer_twig: "KitpagesCmsBundle:Page:template/default.html.twig"
                    data_form_class: '\Kitpages\CmsBundle\Form\Page\DefaultForm'
                    data_form_twig: "KitpagesCmsBundle:Page:form/default.html.twig"
                    zone_list:
                        column:
                            renderer: "default"
                            authorized_block_template_list : ["standard"]
                        main:
                            renderer: "default"
                            authorized_block_template_list : ["standard"]
            default_twig: "::base.html.twig"

    kitpages_file:
        data_dir: %kernel.root_dir%/data/bundle/kitpagesfile
        public_prefix: data/bundle/kitpagesfile
        base_url: %base_url%

    services:
        twig.extension.text:
            class: Twig_Extensions_Extension_Text
            tags:
                - { name: twig.extension }

Create database if needed and update db
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

::

    ./app/console doctrine:database:create
    ./app/console doctrine:schema:update --force
    ./app/console doctrine:fixtures:load

Routing
-------

::

    KitpagesRedirectBundle:
        resource: "@KitpagesRedirectBundle/Resources/config/routing.yml"
        prefix:   /cms/redirect

    kitpages_cms:
        resource: "@KitpagesCmsBundle/Resources/config/routing.yml"
        prefix: "cms"

    kitpages_file:
        resource: "@KitpagesFileBundle/Resources/config/routing.yml"
        prefix: "file"

    kitpages_cms_page_view_lang:
        pattern:  /{lang}/cms/{id}/{urlTitle}
        defaults: { _controller: KitpagesCmsBundle:Page:view, lang: fr }
        requirements:
            id: \d+
            lang:  en|fr

Modify base template
--------------------
Add at the end of the header

::
    {% block kitpages_cms_stylesheets %}{% endblock %}
    {% block kitpages_cms_javascripts %}{% endblock %}

Add at the very beginning of the body :

::

    {% block kitpages_cms_toolbar %}{% endblock %}


Modify security.yml
-------------------

in the file app/conf/security.yml, you need to configure the firewall for every URL.
You can for example change the line

::

    pattern:    ^/demo/secured/

by

::

    pattern:    ^(/demo/secured/|/)

Test the result
===============

* try the URL /cms/arbo
* click on the "edit" button in the top toolbar
* click on one of the home page to edit the page

Commentaires

Ajouter un commentaire
Re: bug sur l'installation
Effectivement cette doc n'est plus très à jour. Je vous conseille d'utiliser l'installation simplifiée en passant par la distribution symfony pour le CMS Kitpages : 
https://github.com/kitpages/symfony-kitpages-cms-edition
bug sur l'installation
Avec les dernières versions des fichiers installés j'ai le bug suivant :

./app/console doctrine:fixtures:load

PHP Fatal error:  Declaration of Kitpages\CmsBundle\DataFixtures\ORM\LoadSiteData::load() must be compatible with that of Doctrine\Common\DataFixtures\FixtureInterface::load() in /home/workspace/test/Symfony/vendor/Kitpages/CmsBundle/DataFixtures/ORM/LoadSiteData.php on line 12
PHP Stack trace:
PHP   1. {main}() /home/workspace/test/Symfony/app/console:0
PHP   2. Symfony\Component\Console\Application->run() /home/workspace/test/Symfony/app/console:22
PHP   3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /home/workspace/test/Symfony/vendor/symfony/src/Symfony/Component/Console/Application.php:118
PHP   4. Symfony\Component\Console\Application->doRun() /home/workspace/test/Symfony/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:75
PHP   5. Symfony\Component\Console\Command\Command->run() /home/workspace/test/Symfony/vendor/symfony/src/Symfony/Component/Console/Application.php:194
PHP   6. Symfony\Bundle\DoctrineFixturesBundle\Command\LoadDataFixturesDoctrineCommand->execute() /home/workspace/test/Symfony/vendor/symfony/src/Symfony/Component/Console/Command/Command.php:224
PHP   7. Doctrine\Common\DataFixtures\Loader->loadFromDirectory() /home/workspace/test/Symfony/vendor/bundles/Symfony/Bundle/DoctrineFixturesBundle/Command/LoadDataFixturesDoctrineCommand.php:97
PHP   8. require_once() /home/workspace/test/Symfony/vendor/bundles/DataFixtures/DataFixturesBundle/lib/Doctrine/Common/DataFixtures/Loader.php:92

Fatal error: Declaration of Kitpages\CmsBundle\DataFixtures\ORM\LoadSiteData::load() must be compatible with that of Doctrine\Common\DataFixtures\FixtureInterface::load() in /home/workspace/test/Symfony/vendor/Kitpages/CmsBundle/DataFixtures/ORM/LoadSiteData.php on line 12

Call Stack:
    0.0002     639928   1. {main}() /home/workspace/test/Symfony/app/console:0
    0.0092    3222032   2. Symfony\Component\Console\Application->run() /home/workspace/test/Symfony/app/console:22
    0.0105    3513456   3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /home/workspace/test/Symfony/vendor/symfony/src/Symfony/Component/Console/Application.php:118
    0.0403    9064960   4. Symfony\Component\Console\Application->doRun() /home/workspace/test/Symfony/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:75
    0.0414    9064960   5. Symfony\Component\Console\Command\Command->run() /home/workspace/test/Symfony/vendor/symfony/src/Symfony/Component/Console/Application.php:194
    0.0416    9066112   6. Symfony\Bundle\DoctrineFixturesBundle\Command\LoadDataFixturesDoctrineCommand->execute() /home/workspace/test/Symfony/vendor/symfony/src/Symfony/Component/Console/Command/Command.php:224
    0.0646   15402816   7. Doctrine\Common\DataFixtures\Loader->loadFromDirectory() /home/workspace/test/Symfony/vendor/bundles/Symfony/Bundle/DoctrineFixturesBundle/Command/LoadDataFixturesDoctrineCommand.php:97
    0.0650   15510592   8. require_once('/home/workspace/test/Symfony/vendor/Kitpages/CmsBundle/DataFixtures/ORM/LoadSiteData.php') /home/workspace/test/Symfony/vendor/bundles/DataFixtures/DataFixturesBundle/lib/Doctrine/Common/DataFixtures/Loader.php:92