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

Commit 0216f8b

Browse files
committed
Merge branch '1.0'
2 parents 604900f + 6caaddb commit 0216f8b

File tree

5 files changed

+149
-8
lines changed

5 files changed

+149
-8
lines changed

bundles/block/types.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,8 @@ Create your first Slideshow
292292

293293
Building a slideshow consists of creating the container ``SlideshowBlock`` and
294294
adding blocks to it. Those blocks can be any kind of blocks, but the
295-
``ImagineBlock`` makes a lot of sense::
295+
``ImagineBlock`` makes a lot of sense. Make sure to have configured the imagine
296+
filter as explained `above <ImagineBlock>`_::
296297

297298
use Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\SlideshowBlock;
298299
use Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\ImagineBlock;
@@ -364,7 +365,7 @@ following line to your sonata admin configuration:
364365
blocks:
365366
label: Blocks
366367
items:
367-
- cmf_block.slideshow_admin
368+
- cmf_block.imagine.slideshow_admin
368369
369370
.. code-block:: xml
370371
@@ -375,7 +376,7 @@ following line to your sonata admin configuration:
375376
<dashboard>
376377
<group id="blocks"
377378
label="Blocks">
378-
<item>cmf_block.slideshow_admin</item>
379+
<item>cmf_block.imagine.slideshow_admin</item>
379380
</group>
380381
</dashboard>
381382
</config>
@@ -390,7 +391,7 @@ following line to your sonata admin configuration:
390391
'blocks' => array(
391392
'label' => 'Blocks',
392393
'items' => array(
393-
'cmf_block.slideshow_admin',
394+
'cmf_block.imagine.slideshow_admin',
394395
),
395396
),
396397
),

bundles/menu/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ MenuBundle
99
menu_factory
1010
menu_provider
1111
voters
12+
sonata_admin

bundles/menu/sonata_admin.rst

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
.. index::
2+
single: Menu; MenuAdmin
3+
4+
Menu Admin with Sonata PHPCR-ODM
5+
================================
6+
7+
If the :doc:`SonataDoctrinePhpcrAdminBundle <../doctrine_phpcr_admin>` is
8+
loaded in the application kernel, menu node and menu documents can be
9+
administrated in Sonata admin. For instructions on how to configure Sonata,
10+
see :doc:`../doctrine_phpcr_admin`.
11+
12+
Loading of Sonata is controlled with the ``use_sonata_admin`` configuration
13+
setting. By default, this option is automatically set based on whether
14+
SonataDoctrinePhpcrAdminBundle is available, but you can explicitly
15+
disable the flag to not provide the Sonata services even if Sonata would be
16+
available. You can also explicitly enable the flag to get an error if Sonata
17+
becomes unavailable.
18+
19+
Sonata admin is using the ``content_basepath`` to show the tree of content to
20+
select the menu node target.
21+
22+
.. configuration-block::
23+
24+
.. code-block:: yaml
25+
26+
# app/config/config.yml
27+
cmf_menu:
28+
dynamic:
29+
persistence:
30+
phpcr:
31+
# use true/false to force using / not using sonata admin
32+
use_sonata_admin: auto
33+
34+
# used with Sonata Admin to manage content; defaults to %cmf_core.basepath%/content
35+
content_basepath: ~
36+
37+
.. code-block:: xml
38+
39+
<!-- app/config/config.xml -->
40+
<?xml version="1.0" encoding="UTF-8" ?>
41+
<container xmlns="http://cmf.symfony.com/schema/dic/services"
42+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
43+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
44+
45+
<config xmlns="http://cmf.symfony.com/schema/dic/menu">
46+
<dynamic>
47+
<persistence>
48+
<!-- use-sonata-admin: use true/false to force using / not using sonata admin -->
49+
<!-- content-basepath: used with Sonata Admin to manage content;
50+
defaults to %cmf_core.basepath%/content -->
51+
<phpcr
52+
use-sonata-admin="auto"
53+
content-basepath="null"
54+
/>
55+
</persistence>
56+
</dynamic>
57+
</config>
58+
</container>
59+
60+
.. code-block:: php
61+
62+
// app/config/config.php
63+
$container->loadFromExtension('cmf_menu', array(
64+
'dynamic' => array(
65+
'persistence' => array(
66+
'phpcr' => array(
67+
// use true/false to force using / not using sonata admin
68+
'use_sonata_admin' => 'auto',
69+
70+
// used with Sonata Admin to manage content; defaults to %cmf_core.basepath%/content
71+
'content_basepath' => null,
72+
),
73+
),
74+
),
75+
));
76+
77+
78+
MenuNodeReferrersInterface Sonata Admin Extension
79+
-------------------------------------------------
80+
81+
This bundle provides an extension to edit referring menu nodes for content that
82+
implements the ``MenuNodeReferrersInterface``.
83+
84+
To enable the extensions in your admin classes, simply define the extension
85+
configuration in the ``sonata_admin`` section of your project configuration:
86+
87+
.. configuration-block::
88+
89+
.. code-block:: yaml
90+
91+
# app/config/config.yml
92+
sonata_admin:
93+
# ...
94+
extensions:
95+
cmf_menu.admin_extension.menu_node_referrers:
96+
implements:
97+
- Symfony\Cmf\Bundle\MenuBundle\Model\MenuNodeReferrersInterface
98+
99+
.. code-block:: xml
100+
101+
<!-- app/config/config.xml -->
102+
<?xml version="1.0" encoding="UTF-8" ?>
103+
<container xmlns="http://cmf.symfony.com/schema/dic/services"
104+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
105+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
106+
107+
<config xmlns="http://sonata-project.org/schema/dic/admin">
108+
<!-- ... -->
109+
<extension id="cmf_menu.admin_extension.menu_node_referrers">
110+
<implement>Symfony\Cmf\Bundle\MenuBundle\Model\MenuNodeReferrersInterface</implement>
111+
</extension>
112+
</config>
113+
</container>
114+
115+
.. code-block:: php
116+
117+
// app/config/config.php
118+
$container->loadFromExtension('sonata_admin', array(
119+
'extensions' => array(
120+
'cmf_menu.admin_extension.menu_node_referrers' => array(
121+
'implements' => array(
122+
'Symfony\Cmf\Bundle\MenuBundle\Model\MenuNodeReferrersInterface',
123+
),
124+
),
125+
),
126+
));
127+
128+
See the `Sonata Admin extension documentation`_ for more information.
129+
130+
.. _`Sonata Admin extension documentation`: http://sonata-project.org/bundles/admin/master/doc/reference/extensions.html

bundles/routing/dynamic.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ select the route target.
308308
309309
<!-- app/config/config.xml -->
310310
<?xml version="1.0" encoding="UTF-8" ?>
311-
312311
<container xmlns="http://cmf.symfony.com/schema/dic/services"
313312
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
314313
@@ -353,6 +352,11 @@ Alternatively, you can use the `Doctrine ORM`_ provider by specifying the
353352
``persistence.orm`` part of the configuration. It does a similar job but, as
354353
the name indicates, loads ``Route`` entities from an ORM database.
355354

355+
.. caution::
356+
357+
You must install the CoreBundle to utilize this feature if your app
358+
does not have at least DoctrineBundle 1.3 installed.
359+
356360
.. _bundles-routing-dynamic-generator:
357361

358362
URL generation with the DynamicRouter
@@ -535,9 +539,7 @@ configuration in the ``sonata_admin`` section of your project configuration:
535539
<config xmlns="http://sonata-project.org/schema/dic/admin">
536540
<!-- ... -->
537541
<extension id="cmf_routing.admin_extension.route_referrers">
538-
<implement>
539-
Symfony\Cmf\Component\Routing\RouteReferrersInterface
540-
</implement>
542+
<implement>Symfony\Cmf\Component\Routing\RouteReferrersInterface</implement>
541543
</extension>
542544
</config>
543545

bundles/routing_auto/introduction.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,13 @@ follows::
235235
After persisting this object, the route will be created. Of course, you need to make
236236
the properties editable and then you have a fully working routing system.
237237

238+
.. note::
239+
240+
Any mapping applied to an object will also apply to subclasses of that
241+
object. Imagine you have 2 documents, ``ContactPage`` and ``Page``, which
242+
both extend ``AbstractPage``. When you map the ``AbstractPage`` class, it
243+
will be applied to both documents.
244+
238245
Provided Providers and Action
239246
-----------------------------
240247

0 commit comments

Comments
 (0)