English spoken conference

Configuration Reference

1.3 version
Maintained Unmaintained
1.2

Configuration Reference

The SimpleCmsBundle can be configured under the cmf_simple_cms key in your application configuration. When using XML, you can use the http://cmf.symfony.com/schema/dic/simplecms namespace.

Configuration

persistence

phpcr

This defines the persistence driver. The default configuration of persistence is the following configuration:

  • YAML
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    cmf_simple_cms:
        persistence:
            phpcr:
                enabled:          false
                basepath:         /cms/simple
                manager_registry: doctrine_phpcr
                manager_name:     ~
                document_class:   Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page
                use_sonata_admin: auto
                sonata_admin:
                    sort: false
    
  • XML
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    <?xml version="1.0" charset="UTF-8" ?>
    <container xmlns="http://symfony.com/schema/dic/services">
    
        <config xmlns="http://cmf.symfony.com/schema/dic/simplecms">
            <persistence>
                <phpcr
                    enabled="false"
                    basepath="/cms/simple"
                    manager-registery="doctrine_phpcr"
                    manager-name="null"
                    document-class="Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page"
                    use-sonata-admin="auto"
                >
                    <sonata-admin sort="false" />
                </phpcr>
            </persistence>
        </config>
    
    </container>
    
  • PHP
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    $container->loadFromExtension('cmf_simple_cms', array(
        'persistence' => array(
            'phpcr' => array(
                'enabled'          => false,
                'basepath'         => '/cms/simple',
                'manager_registry' => 'doctrine_phpcr',
                'manager_name'     => null,
                'document_class'   => 'Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page',
                'use_sonata_admin' => 'auto',
                'sonata_admin' => array(
                    'sort' => false,
                ),
            ),
        ),
    ));
    
enabled

type: boolean default: false

If true, PHPCR is enabled in the service container.

If the CoreBundle is registered, this will default to the value of cmf_core.persistence.phpcr.enabled.

PHPCR can be enabled by multiple ways such as:

  • YAML
    1
    2
    3
    4
    5
    6
    phpcr: ~ # use default configuration
    # or
    phpcr: true # straight way
    # or
    phpcr:
        manager: ... # or any other option under 'phpcr'
    
  • XML
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    <persistence>
        <!-- use default configuration -->
        <phpcr />
    
        <!-- or setting it the straight way -->
        <phpcr>true</phpcr>
    
        <!-- or setting an option under 'phpcr' -->
        <phpcr manager="..." />
    </persistence>
    
  • PHP
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    $container->loadFromExtension(..., array( // bundle configuration key, e.g. cmf_menu
        // ...
        'persistence' => array(
            'phpcr' => null, // use default configuration
            // or
            'phpcr' => true, // straight way
            // or
            'phpcr' => array(
                'manager' => '...', // or any other option under 'phpcr'
            ),
        ),
    ));
    
basepath

type: string default: /cms/simple

The basepath for CMS documents in the PHPCR tree.

If the CoreBundle is registered, this will default to the value of %cmf_core.persistence.phpcr.basepath%/simple.

manager_registry

type: string default: doctrine_phpcr

If the CoreBundle is registered, this will default to the value of cmf_core.persistence.phpcr.manager_registry.

manager_name

type: string default: null

The name of the Doctrine Manager to use. null tells the manager registry to retrieve the default manager.

If the CoreBundle is registered, this will default to the value of cmf_core.persistence.phpcr.manager_name.

document_class

type: string default: 'Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page'

The class for the pages, used by sonata admin.

use_sonata_admin

type: enum valid values: true|false|auto default: auto

If true, the admin classes for SimpleCmsBundle pages are activated. If set to auto, the admin services are activated only if the SonataPhpcrAdminBundle is present.

If the CoreBundle is registered, this will default to the value of cmf_core.persistence.phpcr.use_sonata_admin.

sonata_admin.sort

type: enum valid values: false|asc|desc default: false

If set to asc or desc, sonata admin will ensure that the pages are sorted ascending or descending when storing in PHPCR. Sorting takes publication date first, then creation date.

use_menu

type: enum valid values: true|false|auto default: auto

If set to auto, menu integration is loaded if the CmfMenuBundle is registered with the kernel. If set to true, the integration is always loaded, leading to an error should CmfMenuBundle not be available. Setting it to false does not load the menu integration even if the CmfMenuBundle is registered.

The menu integration loads a menu provider that provides the tree of Pages as menu. The name of that menu is the name used in the basepath.

Note

The default Page model class implements on an interface from KnpMenuBundle, meaning at least that bundle must be in the code base. This is reflected by the composer.json requiring it.

Configure integration with CmfMenuBundle.

  • YAML
    1
    2
    cmf_simple_cms:
        use_menu: auto
    
  • XML
    1
    2
    3
    4
    5
    6
    7
    <?xml version="1.0" charset="UTF-8" ?>
    <container xmlns="http://symfony.com/schema/dic/services">
    
        <config xmlns="http://cmf.symfony.com/schema/dic/simplecms"
            use-menu="auto"
        />
    </container>
    
  • PHP
    1
    2
    3
    $container->loadFromExtension('cmf_simple_cms', array(
        'use_menu' => 'auto',
    ));
    

routing

New in version 1.1: Since SimpleCmsBundle 1.1, this configuration is done directly on the RoutingBundle.

multilang

New in version 1.1: Since SimpleCmsBundle 1.1, this configuration is done directly on the RoutingBundle.

ivory_ckeditor

New in version 1.3: IvoryCKEditorBundle integration was introduced in version 1.3.

This configures integration of the IvoryCKEditorBundle, so an admin can edit content using CKeditor.

  • YAML
    1
    2
    3
    4
    cmf_content:
        ivory_ckeditor:
            enabled:     auto
            config_name: cmf_content
    
  • XML
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    <?xml version="1.0" encoding="UTF-8" ?>
    <container xmlns="http://symfony.com/schema/dic/services"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-Instance"
        xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
        http://cmf.symfony.com/schema/dic/content http://cmf.symfony.com/schema/dic/content/content-1.0.xsd"
    >
    
        <config xmlns="http://cmf.symfony.com/schema/dic/content">
            <ivory-ckeditor enabled="auto" config-name="cmf_content" />
        </config>
    
    </container>
    
  • PHP
    1
    2
    3
    4
    5
    6
    $container->loadFromExtension('cmf_content', array(
        'ivory_ckeditor' => array(
            'enabled'     => true,
            'config_name' => 'cmf_content',
        ),
    ));
    

enabled

type: enum valid values: true|false|auto default: auto

Enables/disables the CKeditor integration. auto will enable the integration only when the IvoryCKEditorBundle is registered. false will always disable the integration.

config_name

type: string default: cmf_content

The name of the IvoryCKEditorBundle config set to use for the editor.

This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.