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

Commit 73a8b58

Browse files
authored
Merge pull request #824 from symfony-cmf/content-update
cleanup content bundle doc
2 parents fea9384 + 6c368fd commit 73a8b58

File tree

7 files changed

+32
-87
lines changed

7 files changed

+32
-87
lines changed

bundles/content/configuration.rst

Lines changed: 11 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Configuration
1313

1414
**type**: ``string`` **default**: ``null``
1515

16-
This defines the template to use when rendering the content if none is
17-
specified in the route. ``{_format}`` and ``{_locale}`` are replaced with the
16+
This defines the template to use when rendering the content if the routing does
17+
not specify the template. ``{_format}`` and ``{_locale}`` are replaced with the
1818
request format and the current locale.
1919

2020
.. _config-content-persistence:
@@ -25,7 +25,6 @@ request format and the current locale.
2525
This defines the persistence driver. The default configuration of persistence
2626
is the following configuration:
2727

28-
2928
.. configuration-block::
3029

3130
.. code-block:: yaml
@@ -35,10 +34,8 @@ is the following configuration:
3534
persistence:
3635
phpcr:
3736
enabled: false
38-
admin_class: ~
39-
document_class: ~
4037
content_basepath: /cms/content
41-
use_sonata_admin: auto
38+
manager_name: null
4239
4340
.. code-block:: xml
4441
@@ -50,10 +47,8 @@ is the following configuration:
5047
<persistence>
5148
<phpcr
5249
enabled="false"
53-
admin_class="null"
54-
document-class="null"
5550
content-basepath="/cms/content"
56-
use-sonata-admin="auto"
51+
manager-name="null"
5752
/>
5853
</persistence>
5954
</config>
@@ -67,10 +62,8 @@ is the following configuration:
6762
'persistence' => [
6863
'phpcr' => [
6964
'enabled' => false,
70-
'admin_class' => null,
71-
'document_class' => null,
7265
'content_basepath' => '/cms/content',
73-
'use_sonata_admin' => 'auto',
66+
'manager_name' => null,
7467
],
7568
],
7669
]);
@@ -80,37 +73,17 @@ is the following configuration:
8073

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

83-
``admin_class``
84-
...............
85-
86-
**type**: ``string`` **default**: ``Symfony\Cmf\Bundle\ContentBundle\Admin\StaticContentAdmin``
87-
88-
The admin class to use when :ref:`Sonata Admin is activated <quick-tour-third-party-sonata>`.
89-
90-
``document_class``
91-
..................
92-
93-
**type**: ``string`` **default**: ``Symfony\Cmf\Bundle\ContentBundle\Doctrine\Phpcr\StaticContent``
94-
95-
The Content class to use.
96-
9776
``content_basepath``
9877
....................
9978

10079
**type**: ``string`` **default**: ``/cms/content``
10180

102-
The basepath for Content documents in the PHPCR tree.
103-
104-
``use_sonata_admin``
105-
....................
81+
The basepath for content documents in the PHPCR tree.
10682

107-
**type**: ``enum`` **valid values**: ``true|false|auto`` **default**: ``auto``
83+
``manager_name``
84+
................
10885

109-
If ``true``, the admin classes for SimpleCmsBundle pages are activated. If set
110-
to ``auto``, the admin services are activated only if the
111-
SonataPhpcrAdminBundle is present.
112-
113-
If the :doc:`CoreBundle <../core/introduction>` is registered, this will
114-
default to the value of ``cmf_core.persistence.phpcr.use_sonata_admin``.
86+
**type**: ``string`` **default**: ``null``
11587

116-
.. include:: ../_partials/ivory_ckeditor.rst.inc
88+
The document manager that holds StaticContent documents. If not set, the
89+
default manager is used.

bundles/content/exposing_content_via_rest.rst

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ Exposing Content via REST
66

77
Many applications need to expose content via REST APIs to partners or to
88
enable integration into other applications. As the CMF is build on top
9-
of Symfony2, it's possible to leverage many of the available bundles to
9+
of Symfony, it's possible to leverage many of the available bundles to
1010
provide a REST API for content stored in the CMF. This guide will
11-
detail how to provide a read API for your content using the following bundles
12-
`FOSRestBundle`_ and `JMSSerializerBundle`_.
11+
detail how to provide a read API for your content using the
12+
`FOSRestBundle`_ and the `JMSSerializerBundle`_.
1313

1414
Installation
1515
------------
@@ -25,19 +25,12 @@ to generate the REST output. The best choice is the JMSSerializerBundle:
2525
...
2626
"require": {
2727
...
28-
"friendsofsymfony/rest-bundle": "1.*",
29-
"jms/serializer-bundle": "0.13.*"
28+
"friendsofsymfony/rest-bundle": "^1.7",
29+
"jms/serializer-bundle": "^1.1"
3030
}
3131
}
3232
33-
.. note::
34-
35-
Both bundles are already required by the CreateBundle.
36-
37-
.. caution::
38-
39-
When using PHPCR-ODM it is necessary to require at least version 1.0.1
40-
of ``doctrine\phpcr-odm``.
33+
And instantiate the two bundles in your application kernel.
4134

4235
Then use Composer_ to update your projects vendors:
4336

bundles/content/introduction.rst

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,13 @@ The ContentController
5858
~~~~~~~~~~~~~~~~~~~~~
5959

6060
The ContentBundle provides a ``ContentController``. This controller can
61-
generically handle incoming requests and forward them to a template. This is
62-
usually used together with the
61+
generically handle incoming requests and render a content document with a
62+
template. This is usually used together with the
6363
:ref:`dynamic router <bundles-routing-dynamic_router-enhancer>`.
6464

6565
Create the Template
6666
...................
6767

68-
In order to render the content, you need to create and configure a template.
69-
This can be done either by using the ``templates_by_class`` setting (see
70-
below) or by configuring the default template.
71-
7268
Any template rendered by the ``ContentController`` will be passed the
7369
``cmfMainContent`` variable, which contains the current ``StaticContent``
7470
document.
@@ -105,6 +101,10 @@ For instance, a very simple template looks like:
105101
<?php echo $cmfMainContent->getBody() ?>
106102
<?php $view['slots']->stop() ?>
107103

104+
In order to render the content, you need to create and configure a template.
105+
Selecting the template can be done either by using the ``templates_by_class``
106+
setting or by configuring the default template.
107+
108108
.. _bundles-content-introduction_default-template:
109109

110110
Configuring a default template
@@ -217,32 +217,12 @@ default is the ``ContentController``.
217217
to controllers and templates. Read more about this topic in the
218218
:ref:`routing configuration reference <reference-config-routing-template_by_class>`.
219219

220-
SonataAdminBundle Integration
221-
-----------------------------
222-
223-
The ContentBundle also provides an Admin class to enable creating, editing and
224-
removing static content from the admin panel. To enable the admin, use the
225-
``cmf_content.persistence.phpcr.use_sonata_admin`` setting. The CMF CoreBundle
226-
also provides :ref:`several useful extensions <bundles-core-persistence>` for
227-
SonataAdminBundle.
228-
229-
.. tip::
230-
231-
Install the IvoryCKEditorBundle_ to enable a CKEditor to edit the content
232-
body:
233-
234-
.. code-block:: bash
235-
236-
$ composer require egeloen/ckeditor-bundle
237-
238-
.. versionadded:: 1.3
239-
IvoryCKEditorBundle integration was introduced in CmfContentBundle 1.3.
240-
241220
Read On
242221
-------
243222

244223
* :doc:`configuration`
245224
* :doc:`exposing_content_via_rest`
225+
* :doc:`Sonata Admin integration <../sonata_phpcr_admin_integration/content>`
246226

247227
.. _`with composer`: https://getcomposer.org
248228
.. _`symfony-cmf/content-bundle`: https://packagist.org/packages/symfony-cmf/content-bundle

bundles/core/introduction.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ Installation
2121
You can install this bundle `with composer`_ using the
2222
`symfony-cmf/core-bundle`_ package.
2323

24-
Sections
25-
--------
24+
Read On
25+
-------
2626

2727
* :doc:`publish_workflow`
2828
* :doc:`templating`
2929
* :doc:`forms`
3030
* :doc:`persistence`
3131
* :doc:`configuration`
32+
* :doc:`Sonata Admin integration <../sonata_phpcr_admin_integration/core>`
3233

3334
.. _`symfony-cmf/core-bundle`: https://packagist.org/packages/symfony-cmf/core-bundle
3435
.. _`with composer`: https://getcomposer.org

bundles/menu/introduction.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ Read On
175175
* :doc:`menu_provider`
176176
* :doc:`voters`
177177
* :doc:`configuration`
178+
* :doc:`Sonata Admin integration <../sonata_phpcr_admin_integration/menu>`
178179

179180
.. _`KnpMenu`: https://github.com/knplabs/KnpMenu
180181
.. _`KnpMenuBundle`: https://github.com/knplabs/KnpMenuBundle

bundles/routing/introduction.rst

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,22 +90,18 @@ will look like this
9090
9191
See also official Symfony `documentation for DependencyInjection tags`_
9292

93-
Sections
94-
--------
95-
96-
* :doc:`dynamic`
97-
* :doc:`dynamic_customize`
98-
9993
Further reading
10094
---------------
10195

10296
For more information on Routing in the Symfony CMF, please refer to:
10397

104-
* The documentation of the :doc:`dynamic`;
10598
* The :doc:`configuration reference <configuration>`;
99+
* The documentation of the :doc:`dynamic`;
100+
* :doc:`dynamic_customize`;
106101
* The :doc:`routing introduction chapter <../../book/routing>` of the book;
107102
* The :doc:`routing component documentation <../../components/routing/introduction>`
108103
for implementation details of the routers;
104+
* :doc:`Sonata Admin integration <../sonata_phpcr_admin_integration/routing>`;
109105
* Symfony's `Routing`_ component documentation.
110106

111107
.. _`with composer`: https://getcomposer.org

bundles/routing_auto/introduction.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ Read more
193193
* :doc:`definitions`
194194
* :doc:`adapter`
195195
* :doc:`configuration`
196+
* :doc:`Sonata Admin integration <../sonata_phpcr_admin_integration/routing_auto>`
196197

197198
.. _`with composer`: https://getcomposer.org/
198199
.. _`symfony-cmf/routing-auto-bundle`: https:/packagist.org/packages/symfony-cmf/routing-auto-bundle

0 commit comments

Comments
 (0)