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

Commit bd1d4ee

Browse files
committed
Merge pull request #493 from symfony-cmf/book
Book
2 parents 8b90794 + 13ccd8c commit bd1d4ee

File tree

5 files changed

+25
-58
lines changed

5 files changed

+25
-58
lines changed

book/database_layer.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,12 @@ After this, you have to create getters and setters for the properties.
181181
For more information about identifier generation strategies, refer to the
182182
`doctrine documentation`_
183183

184+
.. tip::
185+
186+
You may want to implement ``Doctrine\ODM\PHPCR\HierarchyInterface``
187+
which makes it for example possible to leverage the
188+
:ref:`Sonata Admin Child Extension <bundle-core-child-admin-extension>`.
189+
184190
.. seealso::
185191

186192
You can also check out Doctrine's `Basic Mapping Documentation`_ for all
@@ -288,8 +294,8 @@ The repository contains all sorts of helpful methods::
288294
.. tip::
289295

290296
If you use the repository class, you can also create a custom repository
291-
for a specific document. This helps Seperation of Concern when using more
292-
complex queries. This is similair to how it's done in Doctrine ORM, for
297+
for a specific document. This helps with "Seperation of Concern" when using more
298+
complex queries. This is similar to how it's done in Doctrine ORM, for
293299
more information read "`Custom Repository Classes`_" in the core
294300
documentation.
295301

book/installation.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,17 @@ It assumes you have already installed Symfony CMF SE and have carefully read
159159
AcmeMainBundle and SimpleCmsBundle
160160
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
161161

162-
Symfony CMF SE comes with a default AcmeMainBundle to help you get started,
163-
similar to the AcmeDemoBundle provided by Symfony2. This gives you some demo
162+
Symfony CMF SE comes with a default AcmeDemoBundle to help you get started,
163+
similar to the AcmeDemoBundle provided by Symfony2 SE. This gives you some demo
164164
pages viewable in your browser.
165165

166166
.. sidebar:: Where are the Controllers?
167167

168-
AcmeMainBundle doesn't include controllers or configuration files as you
168+
AcmeDemoBundle doesn't include controllers or configuration files as you
169169
might expect. It contains little more than a Twig file and `Fixtures`_
170-
data that was loaded into your database during installation.
170+
data that was loaded into your database during installation. The biggest
171+
chunk of code is the ``UnitBlock`` that provides a document for an example
172+
block.
171173

172174
The controller logic is actually provided by the relevant CMF bundles,
173175
as described below.
@@ -211,7 +213,7 @@ Adding new pages
211213
~~~~~~~~~~~~~~~~
212214

213215
Symfony CMF SE does not provide any admin tools to create new pages. If you
214-
are interested in adding an admin UI have a look at
216+
are interested in adding an admin UI one solution can be found in
215217
:doc:`../cookbook/creating_cms_using_cmf_and_sonata`. However if all you want
216218
is a simple way to add new pages that you can then edit via the inline
217219
editing, then you can use the SimpleCmsBundle ``page`` migrator. The Symfony

book/simplecms.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ First look at the internals
66

77
In most CMS use cases the most basic need is to associate content with a URL.
88
In the Symfony CMF, this is done by using a powerful routing system, provided
9-
by the RoutingBundle, and a ContentBundle. The RoutingBundle provides a
9+
by the RoutingBundle, and the ContentBundle. The RoutingBundle provides a
1010
``Route`` object which can be associated with the ``Content`` object of the
1111
ContentBundle.
1212

1313
Having two objects is the most flexible solution. You can have different
1414
routes (e.g. per language) for the same content. Or you can organize your
15-
content in a different logic than your URL tree. But in many situations,
15+
content in a differently than your URL tree. But in many situations,
1616
having the route and the content be one and the same simplifies things. That
1717
is exactly what the SimpleCmsBundle is doing, which is used by the Symfony
1818
CMF Standard Edition by default for routing, content and menus.

book/static_content.rst

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,37 +25,16 @@ fields are self explanatory and are what you would expect from a basic CMS:
2525
title, body, publishing information and a parent reference, to accommodate a
2626
tree-like hierarchy. It also includes a Block reference (more on that later).
2727

28-
The two implemented interfaces reveal two of the features included in this
29-
implementation:
28+
This document class implements three interfaces that enable additional functionality:
3029

3130
* ``RouteReferrersInterface`` means that the content has associated Routes.
32-
* ``PublishWorkflowInterface`` means that the content has publishing and
31+
* ``PublishTimePeriodInterface`` means that the content has publishing and
3332
unpublishing dates, which will be handled by Symfony CMF's core to
33+
determine whether or not to display the content from ``StaticContent``
34+
* ``PublishableInterface`` means that the content has a boolean flag,
35+
which will be handled by Symfony CMF's core to
3436
determine whether or not to display the content from ``StaticContent``.
3537

36-
Multilang Static Content
37-
------------------------
38-
39-
The ``MultilangStaticContent`` class extends ``StaticContent``, offering the same
40-
functionality with multi language support. It specifies which fields are to be
41-
translated (``title``, ``body`` and ``tags``) as well as a variable to declare
42-
the locale.
43-
44-
It also specifies the translation strategy:
45-
46-
.. configuration-block::
47-
48-
.. code-block:: php-annotations
49-
50-
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCR;
51-
52-
/**
53-
* @PHPCR\Document(translator="child", referenceable=true)
54-
*/
55-
56-
For information on the available translation strategies, refer to the Doctrine
57-
page regarding `multilanguage support in PHPCR-ODM`_.
58-
5938
Content Controller
6039
------------------
6140

book/structuring_content.rst

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ implement ``NodeInterface`` in order to be included in the generated menu.
139139
The Menu Nodes
140140
..............
141141

142-
Also included in the MenuBundle are two menu node content types: ``MenuNode``
143-
and ``MultilangMenuNode``. If you have read the documentation page regarding
144-
:doc:`static_content`, you'll find this implementation somewhat familiar.
142+
Also included in the MenuBundle is the ``MenuNode`` document. If you have
143+
read the documentation page regarding :doc:`static_content`, you'll find
144+
this implementation somewhat familiar.
145145

146146
``MenuNode`` implements the above mentioned ``NodeInterface``, and holds the
147147
information regarding a single menu entry: a ``label`` and a ``uri``, a
@@ -155,25 +155,6 @@ ensured) reference to the actual Content element it points to; it's up to you
155155
to choose which best fits your scenario. You can find more information on
156156
references on the `Doctrine PHPCR documentation page`_.
157157

158-
``MultilangMenuNode`` extends ``MenuNode`` with multilanguage support. It adds
159-
a ``locale`` field to identify which translation set it belongs to, plus
160-
``label`` and ``uri`` fields marked as ``translated=true``. This means they
161-
will differ between translations, unlike the other fields.
162-
163-
``MultilangMenuNode`` also specifies the strategy used to persist multiple
164-
translations:
165-
166-
.. configuration-block::
167-
168-
.. code-block:: php-annotations
169-
170-
/**
171-
* @PHPCR\Document(translator="attribute")
172-
*/
173-
174-
For information on the available translation strategies, refer to the Doctrine
175-
page regarding `Multi language support in PHPCR-ODM`_
176-
177158
Admin Support
178159
~~~~~~~~~~~~~
179160

@@ -197,6 +178,5 @@ configuration options list and additional information.
197178
.. _`KnpMenuBundle's documentation`: https://github.com/KnpLabs/KnpMenuBundle/blob/master/Resources/doc/index.md
198179
.. _`respective documentation page`: https://github.com/KnpLabs/KnpMenuBundle/blob/master/Resources/doc/index.md#rendering-menus
199180
.. _`Doctrine PHPCR documentation page`: http://docs.doctrine-project.org/projects/doctrine-phpcr-odm/en/latest/reference/association-mapping.html#references
200-
.. _`Multi language support in PHPCR-ODM`: http://docs.doctrine-project.org/projects/doctrine-phpcr-odm/en/latest/reference/multilang.html
201181
.. _`KnpMenu`: https://github.com/knplabs/KnpMenu
202182
.. _SonataDoctrinePHPCRAdminBundle: http://sonata-project.org/bundles/doctrine-phpcr-admin/master/doc/index.html

0 commit comments

Comments
 (0)