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

cleanup content bundle doc #824

Merged
merged 1 commit into from
Jul 10, 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
49 changes: 11 additions & 38 deletions bundles/content/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Configuration

**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
This defines the template to use when rendering the content if the routing does
not specify the template. ``{_format}`` and ``{_locale}`` are replaced with the
request format and the current locale.

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


.. configuration-block::

.. code-block:: yaml
Expand All @@ -35,10 +34,8 @@ is the following configuration:
persistence:
phpcr:
enabled: false
admin_class: ~
document_class: ~
content_basepath: /cms/content
use_sonata_admin: auto
manager_name: null

.. code-block:: xml

Expand All @@ -50,10 +47,8 @@ is the following configuration:
<persistence>
<phpcr
enabled="false"
admin_class="null"
document-class="null"
content-basepath="/cms/content"
use-sonata-admin="auto"
manager-name="null"
/>
</persistence>
</config>
Expand All @@ -67,10 +62,8 @@ is the following configuration:
'persistence' => [
'phpcr' => [
'enabled' => false,
'admin_class' => null,
'document_class' => null,
'content_basepath' => '/cms/content',
'use_sonata_admin' => 'auto',
'manager_name' => null,
],
],
]);
Expand All @@ -80,37 +73,17 @@ is the following configuration:

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

``admin_class``
...............

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

The admin class to use when :ref:`Sonata Admin is activated <quick-tour-third-party-sonata>`.

``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``
....................
The basepath for content documents in the PHPCR tree.

**type**: ``enum`` **valid values**: ``true|false|auto`` **default**: ``auto``
``manager_name``
................

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 :doc:`CoreBundle <../core/introduction>` is registered, this will
default to the value of ``cmf_core.persistence.phpcr.use_sonata_admin``.
**type**: ``string`` **default**: ``null``

.. include:: ../_partials/ivory_ckeditor.rst.inc
The document manager that holds StaticContent documents. If not set, the
default manager is used.
19 changes: 6 additions & 13 deletions bundles/content/exposing_content_via_rest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Exposing Content via REST

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

Installation
------------
Expand All @@ -25,19 +25,12 @@ to generate the REST output. The best choice is the JMSSerializerBundle:
...
"require": {
...
"friendsofsymfony/rest-bundle": "1.*",
"jms/serializer-bundle": "0.13.*"
"friendsofsymfony/rest-bundle": "^1.7",
"jms/serializer-bundle": "^1.1"
}
}

.. note::

Both bundles are already required by the CreateBundle.

.. caution::

When using PHPCR-ODM it is necessary to require at least version 1.0.1
of ``doctrine\phpcr-odm``.
And instantiate the two bundles in your application kernel.

Then use Composer_ to update your projects vendors:

Expand Down
34 changes: 7 additions & 27 deletions bundles/content/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,13 @@ The ContentController
~~~~~~~~~~~~~~~~~~~~~

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

Create the Template
...................

In order to render the content, you need to create and configure a template.
This can be done either by using the ``templates_by_class`` setting (see
below) or by configuring the default template.

Any template rendered by the ``ContentController`` will be passed the
``cmfMainContent`` variable, which contains the current ``StaticContent``
document.
Expand Down Expand Up @@ -105,6 +101,10 @@ For instance, a very simple template looks like:
<?php echo $cmfMainContent->getBody() ?>
<?php $view['slots']->stop() ?>

In order to render the content, you need to create and configure a template.
Selecting the template can be done either by using the ``templates_by_class``
setting or by configuring the default template.

.. _bundles-content-introduction_default-template:

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

SonataAdminBundle Integration
-----------------------------

The ContentBundle also provides an Admin class to enable creating, editing and
removing static content from the admin panel. To enable the admin, use the
``cmf_content.persistence.phpcr.use_sonata_admin`` setting. The CMF CoreBundle
also provides :ref:`several useful extensions <bundles-core-persistence>` for
SonataAdminBundle.

.. tip::

Install the IvoryCKEditorBundle_ to enable a CKEditor to edit the content
body:

.. code-block:: bash

$ composer require egeloen/ckeditor-bundle

.. versionadded:: 1.3
IvoryCKEditorBundle integration was introduced in CmfContentBundle 1.3.

Read On
-------

* :doc:`configuration`
* :doc:`exposing_content_via_rest`
* :doc:`Sonata Admin integration <../sonata_phpcr_admin_integration/content>`

.. _`with composer`: https://getcomposer.org
.. _`symfony-cmf/content-bundle`: https://packagist.org/packages/symfony-cmf/content-bundle
Expand Down
5 changes: 3 additions & 2 deletions bundles/core/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ Installation
You can install this bundle `with composer`_ using the
`symfony-cmf/core-bundle`_ package.

Sections
--------
Read On
-------

* :doc:`publish_workflow`
* :doc:`templating`
* :doc:`forms`
* :doc:`persistence`
* :doc:`configuration`
* :doc:`Sonata Admin integration <../sonata_phpcr_admin_integration/core>`

.. _`symfony-cmf/core-bundle`: https://packagist.org/packages/symfony-cmf/core-bundle
.. _`with composer`: https://getcomposer.org
1 change: 1 addition & 0 deletions bundles/menu/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ Read On
* :doc:`menu_provider`
* :doc:`voters`
* :doc:`configuration`
* :doc:`Sonata Admin integration <../sonata_phpcr_admin_integration/menu>`

.. _`KnpMenu`: https://github.com/knplabs/KnpMenu
.. _`KnpMenuBundle`: https://github.com/knplabs/KnpMenuBundle
Expand Down
10 changes: 3 additions & 7 deletions bundles/routing/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,18 @@ will look like this

See also official Symfony `documentation for DependencyInjection tags`_

Sections
--------

* :doc:`dynamic`
* :doc:`dynamic_customize`

Further reading
---------------

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

* The documentation of the :doc:`dynamic`;
* The :doc:`configuration reference <configuration>`;
* The documentation of the :doc:`dynamic`;
* :doc:`dynamic_customize`;
* The :doc:`routing introduction chapter <../../book/routing>` of the book;
* The :doc:`routing component documentation <../../components/routing/introduction>`
for implementation details of the routers;
* :doc:`Sonata Admin integration <../sonata_phpcr_admin_integration/routing>`;
* Symfony's `Routing`_ component documentation.

.. _`with composer`: https://getcomposer.org
Expand Down
1 change: 1 addition & 0 deletions bundles/routing_auto/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ Read more
* :doc:`definitions`
* :doc:`adapter`
* :doc:`configuration`
* :doc:`Sonata Admin integration <../sonata_phpcr_admin_integration/routing_auto>`

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