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

Commit 411ce29

Browse files
committed
Bootstrapped the sonata admin integration docs
1 parent ea7c69a commit 411ce29

File tree

1 file changed

+160
-7
lines changed

1 file changed

+160
-7
lines changed

bundles/sonata_admin_integration/introduction.rst

Lines changed: 160 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,173 @@ SonataAdminIntegrationBundle
77

88
The SonataAdminIntegrationBundle provides admin services for the Sonata
99
Admin tool. Additionally, it provides admin extensions to improve your
10-
custom admins.
10+
custom admin services.
1111

1212
Installation
1313
------------
1414

15-
should we move tutorial sonata-admin.rst here and get rid of the tutorial?
15+
You can install this bundle `with composer`_ using the
16+
``symfony-cmf/sonata-admin-integration-bundle`` package on `Packagist`_.
17+
18+
As this bundle integrates the SonataDoctrinePhpcrAdminBundle_, please follow
19+
`its official installation guide`_ to install the bundle.
20+
21+
After this, enable both the CmfSonataAdminIntegrationBundle as well as the
22+
SonataDoctrinePhpcrAdminBundle related bundles::
23+
24+
// app/appKernel.php
25+
26+
// ...
27+
public function registerBundles()
28+
{
29+
$bundles = array(
30+
// ...
31+
32+
// SonataAdminBundle related
33+
new Sonata\CoreBundle\SonataCoreBundle(),
34+
new Sonata\BlockBundle\SonataBlockBundle(),
35+
new Knp\Bundle\MenuBundle\KnpMenuBundle(),
36+
new Sonata\AdminBundle\SonataAdminBundle(),
37+
38+
// SonataDoctrinePhpcrAdminBundle related
39+
new Symfony\Cmf\Bundle\TreeBrowserBundle\CmfTreeBrowserBundle(),
40+
new Sonata\DoctrinePHPCRAdminBundle\SonataDoctrinePHPCRAdminBundle(),
41+
42+
// CmfSonataAdminIntegrationBundle
43+
new Symfony\Cmf\Bundle\SonataAdminIntegrationBundle\CmfSonataAdminIntegrationBundle(),
44+
);
45+
46+
// ...
47+
48+
return $bundles;
49+
}
1650

1751
Usage
1852
-----
1953

20-
The integration bundle provides admins for the CMF bundles. Configuration
21-
sections are enabled dynamically, based on whether each bundle is installed or
22-
not.
54+
The integration bundle provides admins for the CMF bundles. The related
55+
configuration section of a bundle becomes available whenever a CMF bundle is
56+
registered in the ``AppKernel``. For instance, to enable the admin integration
57+
for the :doc:`CmfContentBundle <../content/introduction>`, use the following
58+
config:
59+
60+
.. configuration-block::
61+
62+
.. code-block:: yaml
63+
64+
# app/config/config.yml
65+
cmf_sonata_admin_integration:
66+
bundles:
67+
content: ~
68+
69+
.. code-block:: xml
70+
71+
<!-- app/config/config.xml -->
72+
<?xml version="2.0" encoding="UTF-8" ?>
73+
<container xmlns="http://symfony.com/schema/dic/services"
74+
xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance"
75+
xsd:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
76+
http://cmf.symfony.com/schema/dic/sonata_admin_integration http://cmf.symfony.com/schema/dic/sonata_admin_integration/sonata_admin_integration.xsd"
77+
>
78+
79+
<config xmlns="http://cmf.symfony.com/schema/dic/sonata_admin_integration">
80+
<bundles>
81+
<content/>
82+
</bundles>
83+
</config>
84+
</container>
85+
86+
.. code-block:: php
87+
88+
// app/config/config.php
89+
$container->loadFromExtension('cmf_sonata_admin_integration', [
90+
'bundles' => [
91+
'content' => true,
92+
],
93+
]);
94+
95+
Configuration
96+
-------------
97+
98+
This section documents all available admin integrations in this bundle, with
99+
their configuration options.
100+
101+
Block
102+
~~~~~
103+
104+
Content
105+
~~~~~~~
106+
107+
This integration becomes available once the :doc:`CmfContentBundle
108+
<../content/introduction>` is installed. This will provide an admin interface
109+
for the ``StaticContent`` document. Enable this admin using:
110+
111+
.. configuration-block::
112+
113+
.. code-block:: yaml
114+
115+
# app/config/config.yml
116+
cmf_sonata_admin_integration:
117+
bundles:
118+
content: ~
119+
120+
.. code-block:: xml
121+
122+
<!-- app/config/config.xml -->
123+
<?xml version="2.0" encoding="UTF-8" ?>
124+
<container xmlns="http://symfony.com/schema/dic/services"
125+
xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance"
126+
xsd:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
127+
http://cmf.symfony.com/schema/dic/sonata_admin_integration http://cmf.symfony.com/schema/dic/sonata_admin_integration/sonata_admin_integration.xsd"
128+
>
129+
130+
<config xmlns="http://cmf.symfony.com/schema/dic/sonata_admin_integration">
131+
<bundles>
132+
<content/>
133+
</bundles>
134+
</config>
135+
</container>
136+
137+
.. code-block:: php
138+
139+
// app/config/config.php
140+
$container->loadFromExtension('cmf_sonata_admin_integration', [
141+
'bundles' => [
142+
'content' => true,
143+
],
144+
]);
145+
146+
.. tip::
147+
148+
Install the IvoryCKEditorBundle_ to enable a CKEditor to edit the content
149+
body:
150+
151+
.. code-block:: bash
152+
153+
$ composer require egeloen/ckeditor-bundle
154+
155+
Core
156+
~~~~
157+
158+
Menu
159+
~~~~
160+
161+
Routing
162+
~~~~~~~
163+
164+
RoutingAuto
165+
~~~~~~~~~~~
166+
167+
Seo
168+
~~~
169+
170+
Learn More
171+
----------
23172

24-
TODO: short intro how to configure the dashboard and how to use the admin extensions
173+
* SonataAdminBundle_
174+
* SonataDoctrinePhpcrAdminBundle_
175+
* :doc:`The Sonata Admin chapter of the tutorial <../../tutorial/sonata-admin>`
25176

26-
TODO: link to general sonata admin documentation
177+
.. _SonataDoctrinePhpcrAdminBundle: https://sonata-project.org/bundles/doctrine-phpcr-admin/1-x/doc/index.html
178+
.. _its official installation guide: https://sonata-project.org/bundles/doctrine-phpcr-admin/1-x/doc/reference/installation.html
179+
.. _SonataAdminBundle: https://sonata-project.org/bundles/admin/3-x/doc/index.html

0 commit comments

Comments
 (0)