You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 16, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: bundles/block.rst
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,8 @@ BlockBundle
2
2
===========
3
3
4
4
The `BlockBundle <https://github.com/symfony-cmf/BlockBundle#readme>`_ provides integration with SonataBlockBundle.
5
-
It assists you in managing fragments of contents, socalled blocks. What the BlockBundle does is similar
6
-
to what Twig does, but for blocks that are persisted in a DB. Thus the blocks can be made editable for an editor.
5
+
It assists you in managing fragments of contents, so-called blocks. What the BlockBundle does is similar
6
+
to what Twig does, but for blocks that are persisted in a DB. Thus, the blocks can be made editable for an editor.
7
7
Also the BlockBundle provides the logic to determine which block should be rendered on which pages.
8
8
9
9
The BlockBundle does not provide an editing functionality for blocks itself. However, you can find examples
@@ -64,7 +64,7 @@ The BlockBundle comes with four general purpose blocks:
64
64
* SimpleBlock: A simple block with nothing but a title and a field of hypertext. This would usually be what an editor edits directly, for example contact information
65
65
* ContainerBlock: A block that contains 0 to n child blocks
66
66
* ReferenceBlock: A block that references a block stored somewhere else in the content tree. For example you might want to refer parts of the contact information from the homepage
67
-
* ActionBlock: A block that calls a Symfony2 action. "Why would I use this instead of directly calling the action from my template?" you might wonder. Well imagine the following case: You provide a block that renders teasers of your latest news. However, there is no rule where they should appear. Instead, your customer wants to decide himself on what pages this block is to be displayed. Providing an according ActionBlock, you allow your customer to do so without calling you to change some templates (over and over again!).
67
+
* ActionBlock: A block that calls a Symfony2 action. "Why would I use this instead of directly calling the action from my template?", you might wonder. Well imagine the following case: You provide a block that renders teasers of your latest news. However, there is no rule where they should appear. Instead, your customer wants to decide himself on what pages this block is to be displayed. Providing an according ActionBlock, you allow your customer to do so without calling you to change some templates (over and over again!).
68
68
69
69
Create your own blocks
70
70
----------------------
@@ -86,7 +86,7 @@ template stored in 'templateName'. You can again extend ``Sonata\BlockBundle\Blo
86
86
It is important, that the 'name' property of the service is called 'my_bundle.block.rss' (this makes
87
87
sure the relation between entity and service can be found).
88
88
89
-
The last thing you need is to define the service in a config file. It is important, to tag your
89
+
The last thing you need is to define the service in a config file. It is important to tag your
90
90
BlockService with 'sonata.block', otherwise it will not be known by the Bundle.
91
91
92
92
Examples
@@ -105,4 +105,4 @@ It replaces components of the bundle where needed to be compatible with PHPCR.
105
105
The following picture shows where we use our own components (blue):
0 commit comments