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

Commit d0b971e

Browse files
committed
Merge pull request #126 from WouterJ/line_length
[Getting Started] Fixed line lengths
2 parents 479ae06 + 1f760da commit d0b971e

File tree

5 files changed

+385
-356
lines changed

5 files changed

+385
-356
lines changed

getting-started/content.rst

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,40 @@ Content
77
Concept
88
-------
99

10-
At the heart of every CMS stands the content, an abstraction that the publishers
11-
can manipulate and that will later be presented to the page's users. The content's
12-
structure greatly depends on the project's needs, and it will have a significant
13-
impact on future development and use of the platform.
10+
At the heart of every CMS stands the content, an abstraction that the
11+
publishers can manipulate and that will later be presented to the page's
12+
users. The content's structure greatly depends on the project's needs, and it
13+
will have a significant impact on future development and use of the platform.
1414

1515
Symfony CMF SE comes with the ContentBundle: a basic implementation of a
16-
content structure, including support for multiple languages and database storage
17-
of Routes.
16+
content structure, including support for multiple languages and database
17+
storage of Routes.
1818

1919
Static Content
2020
--------------
2121

22-
The ``StaticContent`` declares the basic content's structure. Its structure
23-
is very similar to the ones used on Symfony2's ORM systems, and most of its
22+
The ``StaticContent`` declares the basic content's structure. Its structure is
23+
very similar to the ones used on Symfony2's ORM systems, and most of its
2424
fields are self explanatory, and are what you would expect from a basic CMS:
25-
title, body, publishing information and a parent reference, to accommodate
26-
a tree-like hierarchy. It also includes a Block reference (more on that later).
25+
title, body, publishing information and a parent reference, to accommodate a
26+
tree-like hierarchy. It also includes a Block reference (more on that later).
2727

2828
The two implemented interfaces reveal two of the features included in this
2929
implementation:
3030

3131
* ``RouteAwareInterface`` means that the content has associated Routes.
32-
3332
* ``PublishWorkflowInterface`` means that the content has publishing and
34-
unpublishing dates, which will be handled by Symfony CMF's core to determine
35-
access.
33+
unpublishing dates, which will be handled by Symfony CMF's core to
34+
determine access.
3635

3736

3837
Multilang Static Content
3938
------------------------
4039

4140
The ``MultilangStaticContent`` extends ``StaticContent``, offering the same
42-
functionality with multi language support. It specifies which fields are to
43-
be translated (``title``, ``body`` and ``tags``) as well as a variable to
44-
declare the locale.
41+
functionality with multi language support. It specifies which fields are to be
42+
translated (``title``, ``body`` and ``tags``) as well as a variable to declare
43+
the locale.
4544

4645
It also specifies the translation strategy:
4746

@@ -61,43 +60,43 @@ Content Controller
6160
------------------
6261

6362
To handle both content types, a controller is also included. Its inner
64-
workings are pretty straightforward: It accepts a content instance and optionally
65-
a template to render it. If none is provided, it uses a pre-configured default.
66-
It also takes into account the document's publishing status and multi language.
67-
Both the content instance and the optional template are provided to the controller
68-
by the ``DynamicRouter`` of the RoutingExtraBundle. More information on this is
69-
available on the
63+
workings are pretty straightforward: It accepts a content instance and
64+
optionally a template to render it. If none is provided, it uses a
65+
pre-configured default. It also takes into account the document's publishing
66+
status and multi language. Both the content instance and the optional
67+
template are provided to the controller by the ``DynamicRouter`` of the
68+
RoutingExtraBundle. More information on this is available on the
7069
:ref:`Routing system getting started page <start-routing-linking-a-route-with-a-model-instance>`
7170
page.
7271

7372
Admin Support
7473
-------------
7574

76-
The last component needed to handle the included content types is an administration
77-
panel. Symfony CMF can optionally support `SonataDoctrinePHPCRAdminBundle`_
78-
, a back office generation tool. For more information about it, please refer
79-
to the bundle's `documentation section`_.
75+
The last component needed to handle the included content types is an
76+
administration panel. Symfony CMF can optionally support
77+
`SonataDoctrinePHPCRAdminBundle`_ , a back office generation tool. For more
78+
information about it, please refer to the bundle's `documentation section`_.
8079

81-
In ContentBundle, the required administration panels are already declared
82-
in the ``Admin`` folder and configured in ``Resources/config/admin.xml``,
83-
and will automatically be loaded if you install the SonataDoctrinePHPCRAdminBundle
84-
(refer to :doc:`../tutorials/creating-cms-using-cmf-and-sonata` for instructions
85-
on that).
80+
In ContentBundle, the required administration panels are already declared in
81+
the ``Admin`` folder and configured in ``Resources/config/admin.xml``, and
82+
will automatically be loaded if you install the SonataDoctrinePHPCRAdminBundle
83+
(refer to :doc:`../tutorials/creating-cms-using-cmf-and-sonata` for
84+
instructions on that).
8685

8786
Configuration
8887
-------------
8988

90-
The bundle also supports a set of optional configuration parameters. Refer
91-
to :doc:`../bundles/content` for the full configuration reference.
89+
The bundle also supports a set of optional configuration parameters. Refer to
90+
:doc:`../bundles/content` for the full configuration reference.
9291

9392
Final Thoughts
9493
--------------
9594

96-
While this small bundle includes some vital components to a fully working
97-
CMS, it often will not provide all you need. The main idea behind it is to
98-
provide developers with a small and easy to understand starting point you can
99-
extend or use as inspiration to develop your own content types, Controllers and
100-
Admin panels.
95+
While this small bundle includes some vital components to a fully working CMS,
96+
it often will not provide all you need. The main idea behind it is to provide
97+
developers with a small and easy to understand starting point you can extend
98+
or use as inspiration to develop your own content types, Controllers and Admin
99+
panels.
101100

102101
.. _`multilanguage support in PHPCR-ODM`: http://docs.doctrine-project.org/projects/doctrine-phpcr-odm/en/latest/reference/multilang.html
103102
.. _`SonataDoctrinePHPCRAdminBundle`: https://github.com/sonata-project/SonataDoctrinePhpcrAdminBundle

getting-started/installing-symfony-cmf.rst

Lines changed: 90 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -4,46 +4,47 @@
44
Installing the Symfony CMF Standard Edition
55
===========================================
66

7-
The goal of this tutorial is to install all the CMF components with the minimum necessary
8-
configuration and some very simple examples into a working Symfony2 application. This can
9-
be used to familiarize yourself with the CMF or to be used as a starting point for a new
10-
custom application.
7+
The goal of this tutorial is to install all the CMF components with the
8+
minimum necessary configuration and some very simple examples into a working
9+
Symfony2 application. This can be used to familiarize yourself with the CMF or
10+
to be used as a starting point for a new custom application.
1111

12-
If this is your first encounter with the Symfony CMF it would be a good idea to first take a
13-
look at:
12+
If this is your first encounter with the Symfony CMF it would be a good idea
13+
to first take a look at:
1414

15-
- `The Big Picture`_
16-
- The online sandbox demo at `cmf.liip.ch`_
15+
* `The Big Picture`_
16+
* The online sandbox demo at `cmf.liip.ch`_
1717

1818
.. note::
1919

2020
For other Symfony CMF installation guides, please read:
2121

22-
* The cookbook entry on :doc:`../cookbook/installing-cmf-sandbox` for instructions on
23-
how to install a more complete demo instance of Symfony CMF.
24-
* :doc:`../tutorials/installing-cmf-core` for step-by-step installation and
25-
configuration details of just the core components into an existing Symfony
26-
application.
22+
* The cookbook entry on :doc:`../cookbook/installing-cmf-sandbox` for
23+
instructions on how to install a more complete demo instance of Symfony
24+
CMF.
25+
* :doc:`../tutorials/installing-cmf-core` for step-by-step installation
26+
and configuration details of just the core components into an existing
27+
Symfony application.
2728

2829
Preconditions
2930
-------------
3031

3132
As Symfony CMF is based on Symfony2, you should make sure you meet the
32-
`Requirements for running Symfony2`_.
33-
Additionally, you need to have `SQLite`_ PDO extension (``pdo_sqlite``)
34-
installed, since it is used as the default storage medium.
33+
`Requirements for running Symfony2`_. Additionally, you need to have `SQLite`_
34+
PDO extension (``pdo_sqlite``) installed, since it is used as the default
35+
storage medium.
3536

3637
.. note::
3738

38-
By default, Symfony CMF uses Jackalope + Doctrine DBAL and SQLite as
39-
the underlying DB. However, Symfony CMF is storage agnostic, which means
40-
you can use one of several available data storage mechanisms without
41-
having to rewrite your code. For more information on the different
42-
available mechanisms and how to install and configure them, refer to
39+
By default, Symfony CMF uses Jackalope + Doctrine DBAL and SQLite as the
40+
underlying DB. However, Symfony CMF is storage agnostic, which means you
41+
can use one of several available data storage mechanisms without having to
42+
rewrite your code. For more information on the different available
43+
mechanisms and how to install and configure them, refer to
4344
:doc:`../tutorials/installing-configuring-doctrine-phpcr-odm`
4445

45-
`Git`_ and `Curl`_ are also needed to follow the installation steps listed below.
46-
46+
`Git`_ and `Curl`_ are also needed to follow the installation steps listed
47+
below.
4748

4849
Installation
4950
------------
@@ -64,14 +65,15 @@ and then get the Symfony CMF code with it (this may take a while)
6465
6566
.. note::
6667

67-
The path ``<path-to-install>`` should either inside your web server doc root or
68-
configure a virtual host for ``<path-to-install>``.
68+
The path ``<path-to-install>`` should either inside your web server doc
69+
root or configure a virtual host for ``<path-to-install>``.
6970

70-
This will clone the standard edition and install all the dependencies and run some initial commands.
71-
These commands require write permissions to the ``app/cache`` and ``app/logs`` directory. In case
72-
the final commands end up giving permissions errors, please follow the
73-
`guidelines in the symfony book`_ for configuring the permissions and then run the
74-
``composer.phar install`` command mentioned below.
71+
This will clone the standard edition and install all the dependencies and run
72+
some initial commands. These commands require write permissions to the
73+
``app/cache`` and ``app/logs`` directory. In case the final commands end up
74+
giving permissions errors, please follow the `guidelines in the symfony book`_
75+
for configuring the permissions and then run the ``composer.phar install``
76+
command mentioned below.
7577

7678
If you prefer you can also just clone the project:
7779

@@ -80,15 +82,16 @@ If you prefer you can also just clone the project:
8082
$ git clone git://github.com/symfony-cmf/symfony-cmf-standard.git <dir-name>
8183
$ cd <dir-name>
8284
83-
If there were problems during the ``create-project`` command, or if you used ``git clone`` or if you
84-
updated the checkout later, always run the following command to update the dependencies:
85+
If there were problems during the ``create-project`` command, or if you used
86+
``git clone`` or if you updated the checkout later, always run the following
87+
command to update the dependencies:
8588

8689
.. code-block:: bash
8790
8891
$ php composer.phar install
8992
90-
The next step is to setup the database, if you want to use SQLite as your database backend just go
91-
ahead and run the following:
93+
The next step is to setup the database, if you want to use SQLite as your
94+
database backend just go ahead and run the following:
9295

9396
.. code-block:: bash
9497
@@ -97,10 +100,11 @@ ahead and run the following:
97100
$ php app/console doctrine:phpcr:repository:init
98101
$ php app/console doctrine:phpcr:fixtures:load
99102
100-
This will create a file called ``app.sqlite`` inside your app folder, containing the database content.
103+
This will create a file called ``app.sqlite`` inside your app folder,
104+
containing the database content.
101105

102-
The project should now be accessible on your web server. If you have PHP 5.4 installed
103-
you can alternatively use the PHP internal web server:
106+
The project should now be accessible on your web server. If you have PHP 5.4
107+
installed you can alternatively use the PHP internal web server:
104108

105109
.. code-block:: bash
106110
@@ -112,57 +116,63 @@ And then access the CMF via:
112116
113117
http://localhost:8000
114118
115-
If you prefer to use another database backend, for example MySQL, run the configurator (point your browser
116-
to ``/web/config.php``) or set your database connection parameters in ``app/config/parameters.yml``. Make sure you
117-
leave the ``database_path`` property at ``null`` in order to use another driver than SQLite. Leaving the field blank
118-
in the web-configurator should set it to ``null``.
119+
If you prefer to use another database backend, for example MySQL, run the
120+
configurator (point your browser to ``/web/config.php``) or set your database
121+
connection parameters in ``app/config/parameters.yml``. Make sure you leave
122+
the ``database_path`` property at ``null`` in order to use another driver than
123+
SQLite. Leaving the field blank in the web-configurator should set it to
124+
``null``.
119125

120126
Overview
121127
--------
122128

123129
This guide will help you understand the basic parts of Symfony CMF Standard
124-
Edition (SE) and how they work together to provide the default pages you
125-
can see when browsing the Symfony CMF SE installation.
130+
Edition (SE) and how they work together to provide the default pages you can
131+
see when browsing the Symfony CMF SE installation.
126132

127-
It assumes you have already installed Symfony CMF SE and have carefully
128-
read `the Symfony2 book`_.
133+
It assumes you have already installed Symfony CMF SE and have carefully read
134+
`the Symfony2 book`_.
129135

130136
.. note::
131137

132138
For other Symfony CMF installation guides, please read:
133139

134-
* The cookbook entry on :doc:`../cookbook/installing-cmf-sandbox` for instructions on how to
135-
install a more complete demo instance of Symfony CMF.
136-
* :doc:`../tutorials/installing-cmf-core` for step-by-step installation and configuration
137-
details of just the core components into an existing Symfony application.
140+
* The cookbook entry on :doc:`../cookbook/installing-cmf-sandbox` for
141+
instructions on how to install a more complete demo instance of Symfony
142+
CMF.
143+
* :doc:`../tutorials/installing-cmf-core` for step-by-step installation
144+
and configuration details of just the core components into an existing
145+
Symfony application.
138146

139147
AcmeMainBundle and SimpleCMSBundle
140148
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
141149

142-
Symfony CMF SE comes with a default AcmeMainBundle to help you get started,
143-
in a similar way that Symfony2 has AcmeDemoBundle, providing you some
144-
demo pages visible on your browser. However, AcmeMainBundle doesn't include
145-
controllers or configuration files, like you probably would expect. It contains
146-
little more than a twig file and `Fixtures`_ data, that was loaded into your
147-
database during installation.
150+
Symfony CMF SE comes with a default AcmeMainBundle to help you get started, in
151+
a similar way that Symfony2 has AcmeDemoBundle, providing you some demo pages
152+
visible on your browser. However, AcmeMainBundle doesn't include controllers
153+
or configuration files, like you probably would expect. It contains little
154+
more than a twig file and `Fixtures`_ data, that was loaded into your database
155+
during installation.
148156

149157
There are several bundles working together in order to turn the fixture data
150158
into a browsable website. The overall, simplified process is:
151159

152-
* When a request is received, the :doc:`Symfony CMF Routing's Dynamic Router <routing>` is used
153-
to handle the incoming request;
154-
* The Dynamic Router is able to match the requested URL with a specific ContentBundle's Content
155-
stored in the database;
156-
* The retrieved content's information is used to determine which controller to pass it on to, and
157-
which template to use;
160+
* When a request is received, the :doc:`Symfony CMF Routing's Dynamic Router <routing>`
161+
is used to handle the incoming request;
162+
* The Dynamic Router is able to match the requested URL with a specific
163+
ContentBundle's Content stored in the database;
164+
* The retrieved content's information is used to determine which controller to
165+
pass it on to, and which template to use;
158166
* As configured, the retrieved content is passed to ContentBundle's
159-
``ContentController``, which will handle it and render AcmeMainBundle's ``layout.html.twig``.
167+
``ContentController``, which will handle it and render AcmeMainBundle's
168+
``layout.html.twig``.
160169

161-
Again, this is simplified view of a very simple CMS built on top of Symfony CMF.
162-
To fully understand all the possibilities of the CMF, a careful look into
163-
each component is needed.
170+
Again, this is simplified view of a very simple CMS built on top of Symfony
171+
CMF. To fully understand all the possibilities of the CMF, a careful look
172+
into each component is needed.
164173

165-
If you want to review the contents of the PHPCR database you can use the following command:
174+
If you want to review the contents of the PHPCR database you can use the
175+
following command:
166176

167177
.. code-block:: bash
168178
@@ -171,21 +181,25 @@ If you want to review the contents of the PHPCR database you can use the followi
171181
Adding new pages
172182
~~~~~~~~~~~~~~~~
173183

174-
Symfony CMF SE does not provide any admin tools to create new pages. If you are interested in adding
175-
an admin UI have a look at :doc:`../tutorials/creating-cms-using-cmf-and-sonata`. However if all you
176-
want is a simple way to add new pages that you can then edit via the inline editing, then you can
177-
use the SimpleCmsBundle ``page`` migrator. The Symfony CMF SE ships with an example yaml file stored
178-
in ``app/Resources/data/pages/test.yml``. The contents of this file can be loaded into the PHPCR
179-
database by calling:
184+
Symfony CMF SE does not provide any admin tools to create new pages. If you
185+
are interested in adding an admin UI have a look at
186+
:doc:`../tutorials/creating-cms-using-cmf-and-sonata`. However if all you want
187+
is a simple way to add new pages that you can then edit via the inline
188+
editing, then you can use the SimpleCmsBundle ``page`` migrator. The Symfony
189+
CMF SE ships with an example yaml file stored in
190+
``app/Resources/data/pages/test.yml``. The contents of this file can be loaded
191+
into the PHPCR database by calling:
180192

181193
.. code-block:: bash
182194
183195
$ php app/console doctrine:phpcr:migrator page --identifier=/cms/simple/test
184196
185-
Note that the above identifier is mapped to ``app/Resources/data/pages/test.yml`` by stripping
186-
off the ``basepath`` configuration of the SimpleCmsBundle, which defaults to ``/cms/simple``.
187-
Therefore if you want to define a child page ``foo`` for ``/cms/simple/test`` you would need to
188-
create a file ````app/Resources/data/pages/test/foo.yml`` and then run the following command:
197+
Note that the above identifier is mapped to
198+
``app/Resources/data/pages/test.yml`` by stripping off the ``basepath``
199+
configuration of the SimpleCmsBundle, which defaults to ``/cms/simple``.
200+
Therefore if you want to define a child page ``foo`` for ``/cms/simple/test``
201+
you would need to create a file ``app/Resources/data/pages/test/foo.yml``
202+
and then run the following command:
189203

190204
.. code-block:: bash
191205

0 commit comments

Comments
 (0)