Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

update core bundle documentation for 2.0 #816

Merged
merged 1 commit into from
Apr 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion book/database_layer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ After this, you have to create getters and setters for the properties.

You may want to implement ``Doctrine\ODM\PHPCR\HierarchyInterface``
which makes it for example possible to leverage the
:ref:`Sonata Admin Child Extension <bundle-core-child-admin-extension>`.
:doc:`Sonata Admin Child Extension <../bundles/sonata_phpcr_admin_integration/core>`.

.. seealso::

Expand Down
7 changes: 3 additions & 4 deletions book/handling_multilang.rst
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,8 @@ default locale, for example ``/de/admin/dashboard``. When clicking on the
language switcher, the page reloads and displays the correct content for the
requested language.

If your documents implement the TranslatableInterface, you can
:ref:`configure the translatable admin extension <bundle-core-translatable-admin-extension>`
to get a language choice field to let the administrator
choose in which language to store the content.
If your documents implement the TranslatableInterface, use the
SonataTranslationBundle_ to enable multi-language editing in the admin backend.

Frontend Editing and multi-language
-----------------------------------
Expand All @@ -348,3 +346,4 @@ save the edited document in the same language as it was loaded.
.. _`cmf-sandbox config.yml file`: https://github.com/symfony-cmf/cmf-sandbox/blob/master/app/config/config.yml
.. _`PHPCR-ODM documentation on multi-language`: http://docs.doctrine-project.org/projects/doctrine-phpcr-odm/en/latest/reference/multilang.html
.. _`issue`: https://github.com/symfony-cmf/create-bundle/issues/39
.. _SonataTranslationBundle: https://packagist.org/packages/sonata-project/translation-bundle
134 changes: 27 additions & 107 deletions bundles/core/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ configuration. When using XML, you can use the
Configuration
-------------

Some configuration settings set on the CoreBundle are forwarded as default
configuration to all CMF bundles that are installed in your application. This
is explicitly listed below for each configuration option that is forwarded.

.. _config-core-persistence:

``persistence``
Expand All @@ -16,8 +20,8 @@ Configuration
``phpcr``
.........

This defines the persistence driver. The default configuration of persistence
is the following configuration:
This enables the persistence driver for the PHP content repository. The default
configuration is the following:

.. configuration-block::

Expand All @@ -31,7 +35,6 @@ is the following configuration:
basepath: /cms
manager_registry: doctrine_phpcr
manager_name: ~
use_sonata_admin: auto
translation_strategy: ~

.. code-block:: xml
Expand All @@ -47,7 +50,6 @@ is the following configuration:
basepath="/cms"
manager-registery="doctrine_phpcr"
manager-name="null"
use-sonata-admin="auto"
translation-strategy="null"
/>
</persistence>
Expand All @@ -65,7 +67,6 @@ is the following configuration:
'basepath' => '/cms/simple',
'manager_registry' => 'doctrine_phpcr',
'manager_name' => null,
'use_sonata_admin' => 'auto',
'translation_strategy' => null,
],
],
Expand All @@ -74,8 +75,8 @@ is the following configuration:
``orm``
.......

This defines the persistence driver. The default configuration of persistence
is the following configuration:
This enables the persistence driver for relational databases. The default
configuration is the following:

.. configuration-block::

Expand All @@ -87,7 +88,6 @@ is the following configuration:
orm:
enabled: false
manager_name: ~
use_sonata_admin: auto

.. code-block:: xml

Expand All @@ -100,7 +100,6 @@ is the following configuration:
<phpcr
enabled="false"
manager-name="null"
use-sonata-admin="auto"
/>
</persistence>
</config>
Expand All @@ -115,7 +114,6 @@ is the following configuration:
'phpcr' => [
'enabled' => false,
'manager_name' => null,
'use_sonata_admin' => 'auto',
],
],
]);
Expand All @@ -125,7 +123,8 @@ is the following configuration:

.. include:: ../_partials/persistence_phpcr_enabled.rst.inc

Enabling this setting will also automatically enable the equivalent setting in the following Bundles:
This setting is propagated as default value to all installed CMF bundles that support
this setting:

* :doc:`BlockBundle <../block/introduction>`
* :doc:`ContentBundle <../content/introduction>`
Expand All @@ -135,7 +134,6 @@ Enabling this setting will also automatically enable the equivalent setting in t
* :doc:`RoutingBundle <../routing/introduction>`
* :doc:`SearchBundle <../search/introduction>`
* :doc:`SimpleCmsBundle <../simple_cms/introduction>`
* :doc:`TreeBrowserCmsBundle <../tree_browser/introduction>`

``basepath``
""""""""""""
Expand All @@ -144,22 +142,28 @@ Enabling this setting will also automatically enable the equivalent setting in t

The basepath for CMS documents in the PHPCR tree.

Enabling this setting will also automatically enable the equivalent settings in the following Bundles:
This setting is propagated as default value to all installed CMF bundles that support
this setting:

* :doc:`BlockBundle <../block/introduction>`
* :doc:`ContentBundle <../content/introduction>`
* :doc:`MediaBundle <../media/introduction>`
* :doc:`MenuBundle <../menu/introduction>`
* :doc:`RoutingBundle <../routing/introduction>`
* :doc:`SearchBundle <../search/introduction>`
* :doc:`SeoBundle <../seo/introduction>`
* :doc:`SimpleCmsBundle <../simple_cms/introduction>`

``manager_registry``
""""""""""""""""""""

**type**: ``string`` **default**: ``doctrine_phpcr``

Enabling this setting will also automatically enable the equivalent settings in the following Bundles:
The doctrine registry from which to get the document manager. This setting
only needs to be changed when configuring multiple manager registries.

This setting is propagated as default value to all installed CMF bundles that support
this setting:

* :doc:`SearchBundle <../search/introduction>`
* :doc:`SimpleCmsBundle <../simple_cms/introduction>`
Expand All @@ -170,9 +174,10 @@ Enabling this setting will also automatically enable the equivalent settings in
**type**: ``string`` **default**: ``null``

The name of the Doctrine Manager to use. ``null`` tells the manager registry to
retrieve the default manager.<persistence>
retrieve the default manager.

Enabling this setting will also automatically enable the equivalent setting in the following Bundles:
This setting is propagated as default value to all installed CMF bundles that support
this setting:

* :doc:`BlockBundle <../block/introduction>`
* :doc:`MediaBundle <../media/introduction>`
Expand All @@ -181,44 +186,27 @@ Enabling this setting will also automatically enable the equivalent setting in t
* :doc:`SearchBundle <../search/introduction>`
* :doc:`SimpleCmsBundle <../simple_cms/introduction>`

``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.

Enabling this setting will also automatically enable the equivalent setting in the following Bundles:

* :doc:`BlockBundle <../block/introduction>`
* :doc:`ContentBundle <../content/introduction>`
* :doc:`MenuBundle <../menu/introduction>`
* :doc:`RoutingBundle <../routing/introduction>`
* :doc:`SimpleCmsBundle <../simple_cms/introduction>`

``translation_strategy``
""""""""""""""""""""""""

**type**: ``string`` **default**: ``null``

This setting can be used to force a specific translation strategy for all documents.
This setting can be used to :ref:`force a specific translation strategy <bundles-core-multilang-global_translation_strategy>`
for all documents.

.. _config-core-multilang:

``multilang``
~~~~~~~~~~~~~

This configures whether multiple languages mode should be activated.
This configures the locales to use in multiple languages mode.

If the ``multilang`` option is *not* defined at all, the CoreBundle registers a
listener for Doctrine PHPCR-ODM that modifies PHPCR-ODM metadata to remove the
translatable attribute from all fields.

If multi-language is enabled, the ``TranslatableExtension`` for
``SonataAdminBundle`` is enabled and the locales will be configured on all CMF
bundles that use this configuration:
If multi-language is enabled, the locales will be configured as default on all
installed CMF bundles that use this configuration:

* :doc:`RoutingBundle <../routing/introduction>`
* :doc:`SimpleCmsBundle <../simple_cms/introduction>`
Expand Down Expand Up @@ -263,7 +251,7 @@ bundles that use this configuration:

**type**: ``array`` **default**: ``null``

This define languages that can be used.
List of the languages that can be used with the storage.

``publish_workflow``
~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -311,71 +299,3 @@ only published routes and content can be accessed.
'request_listener' => true,
],
]);

Sonata Admin
------------

This section configures the Sonata Admin Extensions, see:

* :ref:`Publish Workflow Admin Extensions <bundle-core-workflow-admin-extensions>`;
* :ref:`Translatable Admin Extension <bundle-core-translatable-admin-extension>`.
* :ref:`Child Admin Extension <bundle-core-child-admin-extension>`.

.. configuration-block::

.. code-block:: yaml

# app/config/config.yml
cmf_core:
sonata_admin:
extensions:
publishable:
form_group: form.group_publish_workflow
publish_time:
form_group: form.group_general
translatable:
form_group: form.group_general

.. code-block:: xml

<!-- app/config/config.xml -->
<?xml version="1.0" charset="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services">

<config xmlns="http://cmf.symfony.com/schema/dic/core">
<sonata-admin>
<extension>
<publishable form-group="form.group_publish_workflow" />
<publish-time form-group="form.group_general" />
<translatable form-group="form.group_general" />
</extension>
</sonata-admin>
</config>
</container>

.. code-block:: php

// app/config/config.php
$container->loadFromExtension('cmf_core', [
'sonata_admin' => [
'extensions' => [
'publishable' => [
'form_group' => 'form.group_publish_workflow',
],
'publish_time' => [
'form_group' => 'form.group_general',
],
'translatable' => [
'form_group' => 'form.group_general',
],
],
],
]);

``form_group``
~~~~~~~~~~~~~~

**type**: ``string`` **default**: as in above example.

Defines which form group the fields from this extension will appear in within
the Sonata Admin edit interface.
18 changes: 0 additions & 18 deletions bundles/core/dependency_injection_tags.rst

This file was deleted.

1 change: 0 additions & 1 deletion bundles/core/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ CoreBundle

introduction
publish_workflow
dependency_injection_tags
templating
persistence
forms
Expand Down
16 changes: 7 additions & 9 deletions bundles/core/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ CoreBundle
This bundle provides common functionality, helpers and utilities for the
other CMF bundles.

One of the provided features is an interface and implementation of a publish
workflow checker with an accompanying interface that models can implement if
they want to support this checker.
The major features are:

Furthermore, it provides a Twig helper exposing several useful functions for
Twig templates to interact with PHPCR-ODM documents.

Finally, most of its configuration settings are automatically applied as
defaults for most of the other CMF Bundles.
* Publish workflow interfaces and publish workflow checker to handle whether
documents should be visible on the site or not;
* Twig helper exposing several useful functions to interact with PHPCR-ODM
documents from within Twig templates;
* Propagate default configuration to the other CMF bundles.

Installation
------------
Expand All @@ -27,8 +25,8 @@ Sections
--------

* :doc:`publish_workflow`
* :doc:`dependency_injection_tags`
* :doc:`templating`
* :doc:`forms`
* :doc:`persistence`
* :doc:`configuration`

Expand Down
Loading