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

Commit 8cab1a0

Browse files
committed
adjust tree browser bundle documentation
1 parent cbd5204 commit 8cab1a0

File tree

2 files changed

+31
-88
lines changed

2 files changed

+31
-88
lines changed

bundles/tree_browser/introduction.rst

Lines changed: 22 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,25 @@ This bundle consists of two parts:
1717
Installation
1818
------------
1919

20-
You can install the bundle in 2 different ways:
21-
22-
* Use the official Git repository (https://github.com/symfony-cmf/TreeBrowserBundle);
23-
* Install it via Composer (``symfony-cmf/tree-browser-bundle`` on `Packagist`_).
20+
You can install this bundle `with composer`_ using the
21+
``symfony-cmf/seo-content-bundle`` package on `Packagist`_.
22+
23+
Both the CmfTreeBrowserBundle and FOSJsRoutingBundle_ must be registered in the
24+
``AppKernel``::
25+
26+
// app/appKernel.php
27+
// ...
28+
public function registerBundles()
29+
{
30+
$bundles = array(
31+
// ...
32+
new FOS\JsRoutingBundle\FOSJsRoutingBundle(),
33+
new Symfony\Cmf\Bundle\TreeBrowserBundle\CmfTreeBrowserBundle(),
34+
);
35+
// ...
36+
37+
return $bundles;
38+
}
2439

2540
Routing
2641
-------
@@ -215,44 +230,11 @@ For example, if your want to open a custom action:
215230
216231
.. note::
217232

218-
Don't forget to add your custom route to the
219-
``fos_js_routing.routes_to_expose`` configuration:
220-
221-
.. configuration-block::
222-
223-
.. code-block:: yaml
224-
225-
fos_js_routing:
226-
routes_to_expose:
227-
- cmf_tree_browser.phpcr_children
228-
- cmf_tree_browser.phpcr_move
229-
- sonata.admin.doctrine_phpcr.phpcrodm_children
230-
- sonata.admin.doctrine_phpcr.phpcrodm_move
231-
- presta_cms_page_edit
232-
233-
.. code-block:: xml
234-
235-
<config xmlns="http://example.org/schema/dic/fos_js_routing">
236-
<routes-to-expose>cmf_tree_browser.phpcr_children</routes-to-expose>
237-
<routes-to-expose>cmf_tree_browser.phpcr_move</routes-to-expose>
238-
<routes-to-expose>sonata.admin.doctrine_phpcr.phpcrodm_children</routes-to-expose>
239-
<routes-to-expose>sonata.admin.doctrine_phpcr.phpcrodm_move</routes-to-expose>
240-
<routes-to-expose>presta_cms_page_edit</routes-to-expose>
241-
</config>
242-
243-
.. code-block:: php
244-
245-
$container->loadFromExtension('fos_js_routing', array(
246-
'routes_to_expose' => array(
247-
'cmf_tree_browser.phpcr_children',
248-
'cmf_tree_browser.phpcr_move',
249-
'sonata.admin.doctrine_phpcr.phpcrodm_children',
250-
'sonata.admin.doctrine_phpcr.phpcrodm_move',
251-
'presta_cms_page_edit',
252-
),
253-
));
233+
This bundle automatically exposes routes with the FOSJsRoutingBundle_
234+
to allow the tree to work.
254235

255236
.. _`Packagist`: https://packagist.org/packages/symfony-cmf/tree-browser-bundle
237+
.. _`with composer`: http://getcomposer.org
256238
.. _`FOSJsRoutingBundle`: https://github.com/FriendsOfSymfony/FOSJsRoutingBundle
257239
.. _`admin_tree.js`: https://github.com/sonata-project/SonataDoctrinePhpcrAdminBundle/blob/master/Resources/views/Tree/tree.html.twig
258240
.. _`select_tree.js`: https://github.com/sonata-project/SonataDoctrinePhpcrAdminBundle/blob/master/Resources/views/Form/form_admin_fields.html.twig

reference/configuration/tree_browser.rst

Lines changed: 9 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ repository and can be configured under the ``cmf_tree_browser`` key in your
66
application configuration. When using XML, you can use the
77
``http://cmf.symfony.com/schema/dic/treebrowser`` namespace.
88

9+
.. note::
10+
11+
To use this bundle with the tree provided by SonataDoctrinePHPCRAdminBundle_,
12+
you do not need to provide any configuration here.
13+
914
Configuration
1015
-------------
1116

@@ -61,57 +66,13 @@ is the following configuration:
6166
enabled
6267
"""""""
6368

64-
**type**: ``boolean`` **default**: ``false``
65-
66-
If ``true``, PHPCR is enabled in the service container.
67-
68-
If the :doc:`CoreBundle <../../bundles/core/index>` is registered, this will default to
69-
the value of ``cmf_core.persistence.phpcr.enabled``.
70-
71-
PHPCR can be enabled by multiple ways such as:
72-
73-
.. configuration-block::
74-
75-
.. code-block:: yaml
76-
77-
phpcr: ~ # use default configuration
78-
# or
79-
phpcr: true # straight way
80-
# or
81-
phpcr:
82-
manager: ... # or any other option under 'phpcr'
83-
84-
.. code-block:: xml
85-
86-
<persistence>
87-
<!-- use default configuration -->
88-
<phpcr />
89-
90-
<!-- or setting it the straight way -->
91-
<phpcr>true</phpcr>
92-
93-
<!-- or setting an option under 'phpcr' -->
94-
<phpcr manager="..." />
95-
</persistence>
96-
97-
.. code-block:: php
98-
99-
$container->loadFromExtension('cmf_simple_cms', array(
100-
// ...
101-
'persistence' => array(
102-
'phpcr' => null, // use default configuration
103-
// or
104-
'phpcr' => true, // straight way
105-
// or
106-
'phpcr' => array(
107-
'manager' => '...', // or any other option under 'phpcr'
108-
),
109-
),
110-
));
69+
.. include:: partials/persistence_phpcr_enabled.rst.inc
11170

11271
session_name
11372
""""""""""""
11473

11574
**type**: ``string`` **default**: ``default``
11675

117-
The name of the connection.
76+
The name of the PHPCR connection to use.
77+
78+
.. _SonataDoctrinePHPCRAdminBundle: http://sonata-project.org/bundles/doctrine-phpcr-admin/master/doc/index.html

0 commit comments

Comments
 (0)