Configuration Reference

1.3 version
Maintained Unmaintained
1.2

Configuration Reference

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

Configuration

default_template

type: string default: null

This defines the template to use when rendering the content if none is specified in the route. {_format} and {_locale} are replaced with the request format and the current locale.

persistence

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

  • YAML
    1
    2
    3
    4
    5
    6
    7
    8
    cmf_content:
        persistence:
            phpcr:
                enabled:          false
                admin_class:      ~
                document_class:   ~
                content_basepath: /cms/content
                use_sonata_admin: auto
    
  • XML
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    <?xml version="1.0" charset="UTF-8" ?>
    <container xmlns="http://symfony.com/schema/dic/services">
    
        <config xmlns="http://cmf.symfony.com/schema/dic/content">
            <persistence>
                <phpcr
                    enabled="false"
                    admin_class="null"
                    document-class="null"
                    content-basepath="/cms/content"
                    use-sonata-admin="auto"
                />
            </persistence>
        </config>
    
    </container>
    
  • PHP
    1
    2
    3
    4
    5
    6
    7
    8
    9
    $container->loadFromExtension('cmf_content', array(
        'persistence' => array(
            'phpcr' => array(
                'enabled'          => false,
                'admin_class'      => null,
                'document_class'   => null,
                'content_basepath' => '/cms/content',
                'use_sonata_admin' => 'auto',
    ));
    

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'
            ),
        ),
    ));
    

admin_class

type: string default: Symfony\Cmf\Bundle\ContentBundle\Admin\StaticContentAdmin

The admin class to use when Sonata Admin is activated.

document_class

type: string default: Symfony\Cmf\Bundle\ContentBundle\Doctrine\Phpcr\StaticContent

The Content class to use.

content_basepath

type: string default: /cms/content

The basepath for Content documents in the PHPCR tree.

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.

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.