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

Commit 280bdf2

Browse files
committed
[WIP] Update doc for RC1
1 parent 5c5c3a6 commit 280bdf2

File tree

1 file changed

+34
-47
lines changed

1 file changed

+34
-47
lines changed

bundles/simple_cms.rst

Lines changed: 34 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,34 @@ See the section below for multilanguage support.
5454
5555
# app/config/config.yml
5656
cmf_simple_cms:
57-
use_menu: auto # use true/false to force providing / not providing a menu
58-
use_sonata_admin: auto # use true/false to force using / not using sonata admin
59-
sonata_admin:
60-
sort: false # set to asc|desc to sort children by publication date
61-
document_class: Symfony\Cmf\Bundle\SimpleCmsBundle\Document\Page
62-
# controller to use to render documents with just custom template
63-
generic_controller: cmf_content.controller:indexAction
64-
# where in the PHPCR tree to store the pages
65-
basepath: /cms/simple
57+
persistence:
58+
phpcr:
59+
enabled: ~
60+
basepath: /cms/simple
61+
manager_registry: doctrine_phpcr
62+
manager_name: ~
63+
document_class: Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page
64+
use_sonata_admin: auto
65+
sonata_admin:
66+
sort: false
67+
use_menu: auto
6668
routing:
69+
generic_controller: cmf_content.controller:indexAction
6770
content_repository_id: cmf_routing.content_repository
71+
uri_filter_regexp:
72+
controllers_by_alias:
73+
74+
# Prototype
75+
alias: []
6876
controllers_by_class:
69-
# ...
77+
78+
# Prototype
79+
alias: []
7080
templates_by_class:
71-
# ...
72-
multilang:
73-
locales: []
81+
82+
# Prototype
83+
alias: []
84+
7485
7586
.. tip::
7687

@@ -83,40 +94,15 @@ See the section below for multilanguage support.
8394
.. code-block:: yaml
8495
8596
cmf_simple_cms:
86-
use_sonata_admin: false
97+
persistence:
98+
phpcr:
99+
sonata_admin: false
87100
88101
Multi-language support
89102
----------------------
90103

91-
The multi-language-mode is enabled by providing the list of allowed locales in
92-
the ``multilang > locales`` field.
93-
94-
In multi-language-mode the Bundle will automatically use the
95-
``Symfony\Cmf\Bundle\SimpleCmsBundle\Document\MultilangPage`` as the
96-
``document_class`` unless a different class is configured explicitly.
97-
98-
This class will by default prefix all routes with ``/{_locale}``. This
99-
behavior can be disabled by setting the second parameter in the constructor of
100-
the model to false.
101-
102-
Furthermore the routing layer will be configured to use
103-
``Symfony\Cmf\Bundle\SimpleCmsBundle\Document\MultilangRouteRepository`` which
104-
will ensure that even with the locale prefix the right content node will be
105-
found. Furthermore it will automatically add a ``_locale`` requirement listing
106-
the current available locales for the matched route.
107-
108-
.. note::
109-
110-
Since SimpleCmsBundle only provides a single tree structure, all nodes
111-
will have the same node name for all languages. So a url
112-
``http://foo.com/en/bar`` for english content will look like
113-
``http://foo.com/de/bar`` for german content. At times it might be most
114-
feasible to use integers as the node names and simple append the title of
115-
the node in the given locale as an anchor. So for example
116-
``http://foo.com/de/1#my title`` and ``http://foo.com/de/1#mein title``.
117-
If you need language specific URLs, you want to use the CMF routing bundle
118-
and content bundle directly to have a separate route document per
119-
language.
104+
@todo: Explain how multilang works now, in particular the use of ``->addLocaleFormat`` on
105+
the ``Page`` document.
120106

121107
Rendering
122108
---------
@@ -157,7 +143,7 @@ chapter :doc:`create`.
157143
Extending the Page class
158144
------------------------
159145

160-
The default Page document ``Symfony\Cmf\Bundle\SimpleCmsBundle\Document\Page``
146+
The default Page document ``Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page``
161147
is relatively simple, shipping with a handful of the most common properties
162148
for building a typical page: title, body, tags, publish dates etc.
163149

@@ -171,9 +157,10 @@ configuration parameter to your own document class:
171157
172158
# app/config/config.yml
173159
cmf_simple_cms:
174-
# ...
175-
document_class: Acme\DemoBundle\Document\MySuperPage
176-
# ...
160+
persistence:
161+
phpcr:
162+
document_class: Acme\DemoBundle\Document\MySuperPage
163+
# ...
177164
178165
Alternatively, the default Page document contains an ``extras`` property. This
179166
is a key - value store (where value must be string or null) which can be used

0 commit comments

Comments
 (0)