English spoken conference
WARNING: You are browsing the documentation for version 1.2 which is not maintained anymore. If some of your projects are still using this version, consider upgrading.

Configuration Reference

1.2 version

Configuration Reference

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

Configuration

persistence

phpcr

  • YAML
    1
    2
    3
    4
    5
    6
    # app/config/config.yml
    cmf_seo:
        persistence:
            phpcr:
                enabled: false
                manager_name: ~
    
  • XML
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    <!-- app/config/config.xml -->
    <?xml version="1.0" encoding="UTF-8" ?>
    <container xmlns="http://symfony.com/schema/dic/services">
        <config xmlns="http://cmf.symfony.com/schema/dic/seo">
            <persistence>
                <phpcr
                    enabled="false"
                    manager-name="null"
                />
            </persistence>
        </config>
    </container>
    
  • PHP
    1
    2
    3
    4
    5
    6
    7
    8
    $container->loadFromExtension('cmf_seo', array(
        'persistence' => array(
            'phpcr' => array(
                'enabled' => false,
                'manager_name' => null,
            ),
        ),
    ));
    
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'
            ),
        ),
    ));
    
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.

translation_domain

type: string default: messages

The translation domain to use when translating the title and description template. See Defining a Title and Description Template for more information.

title

type: string default: null

The title template, read here about the usage.

description

type: string default: null

The description template, read here about the usage.

original_route_pattern

type: string default: canonical

The original route strategy to use when multiple routes have the same content. Can be one of canonical or redirect.

content_key

type: string default: null (or DynamicRouter::CONTENT_KEY when RoutingBundle is enabled)

The name of the request attribute which contains the content object. This is used by the ContentListener to exctract SEO information automatically. If the RoutingBundle is present, this defaults to DynamicRouter::CONTENT_KEY (which evaluates to contentDocument), otherwise you must define this manually.

sonata_admin_extension

If set to true, the Sonata Admin Extension provided by the SeoBundle is activated.

enabled

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

If true, the Sonata Admin Extension will be activated. If set to auto, it is 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.

form_group

type: string default: form.group_seo

The name of the form group of the group provided by the Sonata Admin Extension.

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