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

Commit c8e0d03

Browse files
committed
update core bundle documentation for 2.0
1 parent f7078fe commit c8e0d03

File tree

10 files changed

+275
-345
lines changed

10 files changed

+275
-345
lines changed

book/database_layer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ After this, you have to create getters and setters for the properties.
185185

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

190190
.. seealso::
191191

book/handling_multilang.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,8 @@ default locale, for example ``/de/admin/dashboard``. When clicking on the
320320
language switcher, the page reloads and displays the correct content for the
321321
requested language.
322322

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

328326
Frontend Editing and multi-language
329327
-----------------------------------
@@ -348,3 +346,4 @@ save the edited document in the same language as it was loaded.
348346
.. _`cmf-sandbox config.yml file`: https://github.com/symfony-cmf/cmf-sandbox/blob/master/app/config/config.yml
349347
.. _`PHPCR-ODM documentation on multi-language`: http://docs.doctrine-project.org/projects/doctrine-phpcr-odm/en/latest/reference/multilang.html
350348
.. _`issue`: https://github.com/symfony-cmf/create-bundle/issues/39
349+
.. _SonataTranslationBundle: https://packagist.org/packages/sonata-project/translation-bundle

bundles/core/configuration.rst

Lines changed: 23 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ Configuration
1616
``phpcr``
1717
.........
1818

19-
This defines the persistence driver. The default configuration of persistence
20-
is the following configuration:
19+
This enables the persistence driver for the PHP content repository. The default
20+
configuration is the following:
2121

2222
.. configuration-block::
2323

@@ -31,7 +31,6 @@ is the following configuration:
3131
basepath: /cms
3232
manager_registry: doctrine_phpcr
3333
manager_name: ~
34-
use_sonata_admin: auto
3534
translation_strategy: ~
3635
3736
.. code-block:: xml
@@ -47,7 +46,6 @@ is the following configuration:
4746
basepath="/cms"
4847
manager-registery="doctrine_phpcr"
4948
manager-name="null"
50-
use-sonata-admin="auto"
5149
translation-strategy="null"
5250
/>
5351
</persistence>
@@ -65,7 +63,6 @@ is the following configuration:
6563
'basepath' => '/cms/simple',
6664
'manager_registry' => 'doctrine_phpcr',
6765
'manager_name' => null,
68-
'use_sonata_admin' => 'auto',
6966
'translation_strategy' => null,
7067
],
7168
],
@@ -74,8 +71,8 @@ is the following configuration:
7471
``orm``
7572
.......
7673

77-
This defines the persistence driver. The default configuration of persistence
78-
is the following configuration:
74+
This enables the persistence driver for relational databases. The default
75+
configuration is the following:
7976

8077
.. configuration-block::
8178

@@ -87,7 +84,6 @@ is the following configuration:
8784
orm:
8885
enabled: false
8986
manager_name: ~
90-
use_sonata_admin: auto
9187
9288
.. code-block:: xml
9389
@@ -100,7 +96,6 @@ is the following configuration:
10096
<phpcr
10197
enabled="false"
10298
manager-name="null"
103-
use-sonata-admin="auto"
10499
/>
105100
</persistence>
106101
</config>
@@ -115,7 +110,6 @@ is the following configuration:
115110
'phpcr' => [
116111
'enabled' => false,
117112
'manager_name' => null,
118-
'use_sonata_admin' => 'auto',
119113
],
120114
],
121115
]);
@@ -125,7 +119,8 @@ is the following configuration:
125119

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

128-
Enabling this setting will also automatically enable the equivalent setting in the following Bundles:
122+
This setting is propagated as default value to all CMF bundles that support
123+
this setting:
129124

130125
* :doc:`BlockBundle <../block/introduction>`
131126
* :doc:`ContentBundle <../content/introduction>`
@@ -135,7 +130,6 @@ Enabling this setting will also automatically enable the equivalent setting in t
135130
* :doc:`RoutingBundle <../routing/introduction>`
136131
* :doc:`SearchBundle <../search/introduction>`
137132
* :doc:`SimpleCmsBundle <../simple_cms/introduction>`
138-
* :doc:`TreeBrowserCmsBundle <../tree_browser/introduction>`
139133

140134
``basepath``
141135
""""""""""""
@@ -144,22 +138,28 @@ Enabling this setting will also automatically enable the equivalent setting in t
144138

145139
The basepath for CMS documents in the PHPCR tree.
146140

147-
Enabling this setting will also automatically enable the equivalent settings in the following Bundles:
141+
This setting is propagated as default value to all CMF bundles that support
142+
this setting:
148143

149144
* :doc:`BlockBundle <../block/introduction>`
150145
* :doc:`ContentBundle <../content/introduction>`
151146
* :doc:`MediaBundle <../media/introduction>`
152147
* :doc:`MenuBundle <../menu/introduction>`
153148
* :doc:`RoutingBundle <../routing/introduction>`
154149
* :doc:`SearchBundle <../search/introduction>`
150+
* :doc:`SeoBundle <../seo/introduction>`
155151
* :doc:`SimpleCmsBundle <../simple_cms/introduction>`
156152

157153
``manager_registry``
158154
""""""""""""""""""""
159155

160156
**type**: ``string`` **default**: ``doctrine_phpcr``
161157

162-
Enabling this setting will also automatically enable the equivalent settings in the following Bundles:
158+
The doctrine registry from which to get the document manager. This setting
159+
only needs to be changed when configuring multiple manager registries.
160+
161+
This setting is propagated as default value to all CMF bundles that support
162+
this setting:
163163

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

172172
The name of the Doctrine Manager to use. ``null`` tells the manager registry to
173-
retrieve the default manager.<persistence>
173+
retrieve the default manager.
174174

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

177178
* :doc:`BlockBundle <../block/introduction>`
178179
* :doc:`MediaBundle <../media/introduction>`
@@ -181,44 +182,27 @@ Enabling this setting will also automatically enable the equivalent setting in t
181182
* :doc:`SearchBundle <../search/introduction>`
182183
* :doc:`SimpleCmsBundle <../simple_cms/introduction>`
183184

184-
``use_sonata_admin``
185-
""""""""""""""""""""
186-
187-
**type**: ``enum`` **valid values**: ``true|false|auto`` **default**: ``auto``
188-
189-
If ``true``, the admin classes for SimpleCmsBundle pages are activated. If set
190-
to ``auto``, the admin services are activated only if the
191-
SonataPhpcrAdminBundle is present.
192-
193-
Enabling this setting will also automatically enable the equivalent setting in the following Bundles:
194-
195-
* :doc:`BlockBundle <../block/introduction>`
196-
* :doc:`ContentBundle <../content/introduction>`
197-
* :doc:`MenuBundle <../menu/introduction>`
198-
* :doc:`RoutingBundle <../routing/introduction>`
199-
* :doc:`SimpleCmsBundle <../simple_cms/introduction>`
200-
201185
``translation_strategy``
202186
""""""""""""""""""""""""
203187

204188
**type**: ``string`` **default**: ``null``
205189

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

208193
.. _config-core-multilang:
209194

210195
``multilang``
211196
~~~~~~~~~~~~~
212197

213-
This configures whether multiple languages mode should be activated.
198+
This configures the locales to use in multiple languages mode.
214199

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

219-
If multi-language is enabled, the ``TranslatableExtension`` for
220-
``SonataAdminBundle`` is enabled and the locales will be configured on all CMF
221-
bundles that use this configuration:
204+
If multi-language is enabled, the locales will be configured as default on all
205+
CMF bundles that use this configuration:
222206

223207
* :doc:`RoutingBundle <../routing/introduction>`
224208
* :doc:`SimpleCmsBundle <../simple_cms/introduction>`
@@ -263,7 +247,7 @@ bundles that use this configuration:
263247

264248
**type**: ``array`` **default**: ``null``
265249

266-
This define languages that can be used.
250+
List of the languages that can be used with the storage.
267251

268252
``publish_workflow``
269253
~~~~~~~~~~~~~~~~~~~~
@@ -311,71 +295,3 @@ only published routes and content can be accessed.
311295
'request_listener' => true,
312296
],
313297
]);
314-
315-
Sonata Admin
316-
------------
317-
318-
This section configures the Sonata Admin Extensions, see:
319-
320-
* :ref:`Publish Workflow Admin Extensions <bundle-core-workflow-admin-extensions>`;
321-
* :ref:`Translatable Admin Extension <bundle-core-translatable-admin-extension>`.
322-
* :ref:`Child Admin Extension <bundle-core-child-admin-extension>`.
323-
324-
.. configuration-block::
325-
326-
.. code-block:: yaml
327-
328-
# app/config/config.yml
329-
cmf_core:
330-
sonata_admin:
331-
extensions:
332-
publishable:
333-
form_group: form.group_publish_workflow
334-
publish_time:
335-
form_group: form.group_general
336-
translatable:
337-
form_group: form.group_general
338-
339-
.. code-block:: xml
340-
341-
<!-- app/config/config.xml -->
342-
<?xml version="1.0" charset="UTF-8" ?>
343-
<container xmlns="http://symfony.com/schema/dic/services">
344-
345-
<config xmlns="http://cmf.symfony.com/schema/dic/core">
346-
<sonata-admin>
347-
<extension>
348-
<publishable form-group="form.group_publish_workflow" />
349-
<publish-time form-group="form.group_general" />
350-
<translatable form-group="form.group_general" />
351-
</extension>
352-
</sonata-admin>
353-
</config>
354-
</container>
355-
356-
.. code-block:: php
357-
358-
// app/config/config.php
359-
$container->loadFromExtension('cmf_core', [
360-
'sonata_admin' => [
361-
'extensions' => [
362-
'publishable' => [
363-
'form_group' => 'form.group_publish_workflow',
364-
],
365-
'publish_time' => [
366-
'form_group' => 'form.group_general',
367-
],
368-
'translatable' => [
369-
'form_group' => 'form.group_general',
370-
],
371-
],
372-
],
373-
]);
374-
375-
``form_group``
376-
~~~~~~~~~~~~~~
377-
378-
**type**: ``string`` **default**: as in above example.
379-
380-
Defines which form group the fields from this extension will appear in within
381-
the Sonata Admin edit interface.

bundles/core/dependency_injection_tags.rst

Lines changed: 0 additions & 18 deletions
This file was deleted.

bundles/core/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ CoreBundle
66

77
introduction
88
publish_workflow
9-
dependency_injection_tags
109
templating
1110
persistence
1211
forms

bundles/core/introduction.rst

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@ CoreBundle
77
This bundle provides common functionality, helpers and utilities for the
88
other CMF bundles.
99

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

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

2018
Installation
2119
------------
@@ -27,8 +25,8 @@ Sections
2725
--------
2826

2927
* :doc:`publish_workflow`
30-
* :doc:`dependency_injection_tags`
3128
* :doc:`templating`
29+
* :doc:`forms`
3230
* :doc:`persistence`
3331
* :doc:`configuration`
3432

0 commit comments

Comments
 (0)