4
4
The Big Picture
5
5
===============
6
6
7
- Start using the Symfony CMF in 10 minutes! This chapter will walk you through
7
+ Start using the Symfony CMF in 10 minutes! This quick tour will walk you through
8
8
the base concepts of the Symfony CMF and get you started with it.
9
9
10
10
It's important to know that the Symfony CMF is a collection of bundles which
@@ -13,7 +13,7 @@ Framework. Before you read further, you should at least have a basic knowledge
13
13
of the Symfony Framework. If you don't know Symfony, start by reading the
14
14
`Symfony Framework Quick Tour `_.
15
15
16
- Solving the framework versus CMS dilemma
16
+ Solving the Framework versus CMS Dilemma
17
17
----------------------------------------
18
18
19
19
Before starting a new project, there is a difficult decision on whether it
@@ -25,12 +25,12 @@ the core parts of the CMS.
25
25
26
26
The CMF is created to solve this framework versus CMS dilemma. It provides
27
27
bundles, so you can easily add CMS features to your project. But it also
28
- provides flexibility and in all cases you are using the framework, so you can
28
+ provides flexibility and you can use the underlying Symfony framework to
29
29
build custom functionality the way you want. This is called a `decoupled CMS `_.
30
30
31
31
The bundles provided by the Symfony CMF can work together, but they are also
32
32
able to work standalone. This means that you don't need to add all bundles, you
33
- can decide to only use one of them (e.g. only the RoutingBundle or the MediaBundle ).
33
+ can decide to only use one of them (e.g. only the RoutingBundle or the SeoBundle ).
34
34
35
35
Downloading the Symfony CMF Standard Edition
36
36
--------------------------------------------
@@ -45,16 +45,8 @@ The best way to download the Symfony CMF Standard Edition is using Composer_:
45
45
46
46
.. code-block :: bash
47
47
48
- $ composer create-project symfony-cmf/standard-edition cmf ' 1.2.1 '
48
+ $ composer create-project symfony-cmf/standard-edition cmf
49
49
50
- .. note ::
51
-
52
- The `AcmeDemoBundle ` that is used in this tour was removed in
53
- version 1.3 of the Symfony CMF Standard Edition. Since then it has
54
- become the skeleton for a simple CMS application. This is why we
55
- install version 1.2.1. If you insist on checking out the most
56
- recent versions of the CMF, check out `symfony-cmf/cmf-sandbox `.
57
-
58
50
Setting up the Database
59
51
~~~~~~~~~~~~~~~~~~~~~~~
60
52
@@ -63,14 +55,15 @@ something you are used to doing when creating Symfony applications, but the
63
55
Symfony CMF needs a database in order to make a lot of things configurable
64
56
using an admin interface.
65
57
66
- To quickly get started, it is expected that you have enabled the sqlite
58
+ To quickly get started, it is expected that you have enabled the sqlite PHP
67
59
extension. After that, run these commands:
68
60
69
61
.. code-block :: bash
70
62
71
63
$ php bin/console doctrine:database:create
72
- $ php bin/console doctrine:phpcr:init:dbal
64
+ $ php bin/console doctrine:phpcr:init:dbal --force
73
65
$ php bin/console doctrine:phpcr:repository:init
66
+ # TODO there are no fixtures in the standard edition anymore...
74
67
$ php bin/console doctrine:phpcr:fixtures:load
75
68
76
69
.. tip ::
@@ -88,9 +81,11 @@ The Request Flow
88
81
89
82
.. tip ::
90
83
91
- When you have at least PHP 5.4, use the ``server:run `` command to run a
92
- local server for the demo. Otherwise, use a ``localhost `` and prefix the URLs
93
- in this document with ``/path-to-project/web/app_dev.php/ ``.
84
+ Use the ``server:run `` command to run a local server for the demo. If you
85
+ use a web server like Nginx or Apache, you need to prefix the URLs
86
+ in this document with ``app_dev.php/ `` (and the path to the ``web `` folder
87
+ inside the Symfony project, if that is not already the root folder of your
88
+ server).
94
89
95
90
Now, the Standard Edition is ready to use. Navigate to the homepage
96
91
(``http://localhost:8000/ ``) to see the demo:
@@ -175,13 +170,15 @@ Adding a New Page
175
170
176
171
Now you know the request flow, you can start adding a new page. In the Symfony
177
172
CMF Standard Edition, the data is stored in data files, which are loaded when
178
- executing the ``doctrine:phpcr:fixtures:load `` command. To add a new page, you
179
- just need to edit such a data file, which is located in the
180
- ``src/Acme/DemoBundle/Resources/data `` directory:
173
+ executing the ``doctrine:phpcr:fixtures:load `` command. To add a new page, edit
174
+ one of the data files located in the
175
+ ``src/AppBundle/Resources/data `` directory:
176
+
177
+ TODO: replace example, simplecms bundle is not maintained anymore
181
178
182
179
.. code-block :: yaml
183
180
184
- # src/Acme/DemoBundle /Resources/data/pages.yml
181
+ # src/AppBundle /Resources/data/pages.yml
185
182
Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page :
186
183
# ...
187
184
@@ -196,28 +193,6 @@ the changes on the database and after refreshing, you can see your new page!
196
193
197
194
.. image :: ../_images/quick_tour/big-picture-new-page.png
198
195
199
- Live Editing
200
- ------------
201
-
202
- Now is the time you become an admin of this site and editing the content using
203
- the Web Interface. To do this click on "Admin Login" and use the provided
204
- credentials.
205
-
206
- You'll see that you have a new bar at the top of the page:
207
-
208
- .. image :: ../_images/quick_tour/big-picture-createjs-bar.png
209
-
210
- This bar is generated by the `Create.js `_ library. The Symfony CMF integrates
211
- the CreatePHP _ and `Create.js `_ libraries using a CreateBundle. This enables
212
- you to edit a page using a full WYSIWYG editor when you are reading the page.
213
-
214
- Now you can change the content of our new page using Create.js:
215
-
216
- .. image :: ../_images/quick_tour/big-picture-edit-page.png
217
-
218
- After clicking "save", the changes are saved using the CreateBundle and the
219
- content is updated.
220
-
221
196
Final Thoughts
222
197
--------------
223
198
0 commit comments