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

Commit 2523a22

Browse files
Roel Sintdbu
Roel Sint
authored andcommitted
block: classes checked + added sonata prepended config
1 parent 068cfb6 commit 2523a22

File tree

3 files changed

+33
-6
lines changed

3 files changed

+33
-6
lines changed

bundles/block/introduction.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,29 @@ change features of one or more Admin instances. Read more about
116116
),
117117
));
118118
119+
.. _bundle-block-updated-sonata-defaults:
120+
121+
Updated SonataBlockBundle defaults
122+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
123+
124+
The BlockBundle *automatically* changes some defaults and adds configuration
125+
to the `SonataBlockBundle`_ to make it work nicely. This is done using the
126+
`prepended configuration`_ option of Symfony available since version 2.2.
127+
See ``DependencyInjection\CmfBlockExtension::prepend``.
128+
129+
Updated defaults:
130+
131+
* **templates.block_base** the cmf base template wraps the block output in
132+
a div and dashifies the PHPCR path as id; The base template is
133+
kept compatible with the Sonata base template for non-cmf blocks;
134+
* **RssBlock configuration** adds the
135+
:ref:`default RssBlock settings <bundle-block-rss-settings>`.
136+
137+
.. note::
138+
139+
Settings are only prepended, define the settings explicitly inside
140+
the ``app/config/config.yml`` to override them.
141+
119142
.. _bundle-block-document:
120143

121144
Block Document

cookbook/using_blockbundle_and_contentbundle.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ sample block, so create the ``LoadBlockWithCmfParent.php`` class::
371371
use Symfony\Component\DependencyInjection\ContainerInterface;
372372
use PHPCR\Util\NodeHelper;
373373
use Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\SimpleBlock;
374-
use Symfony\Cmf\Bundle\ContentBundle\Document\StaticContent;
374+
use Symfony\Cmf\Bundle\ContentBundle\Doctrine\Phpcr\StaticContent;
375375

376376
class LoadBlockWithCmfParent extends AbstractFixture implements ContainerAwareInterface
377377
{
@@ -389,7 +389,7 @@ sample block, so create the ``LoadBlockWithCmfParent.php`` class::
389389
$document->setPath($basepath . '/blocks');
390390
$manager->persist($document);
391391

392-
// Create a new SimpleBlock (see http://symfony.com/doc/master/cmf/bundles/block.html#block-types)
392+
// Create a new SimpleBlock
393393
$myBlock = new SimpleBlock();
394394
$myBlock->setParentDocument($document);
395395
$myBlock->setName('testBlock');
@@ -411,17 +411,17 @@ This class creates an example content page using the CMF ContentBundle. It
411411
then loads our example block as before, using the new content page as its
412412
parent.
413413

414-
By default, the base path for the content is ``/cms/content/static``. To show
415-
how it can be configured to any path, add the following, optional entry to
416-
your ``config.yml``:
414+
By default, the base path for the content is ``/cms/content``. To show how it
415+
can be configured to any path, add the following, optional entry to your
416+
``config.yml``:
417417

418418
.. configuration-block::
419419

420420
.. code-block:: yaml
421421
422422
# app/config/config.yml
423423
cmf_content:
424-
static_basepath: /content
424+
content_basepath: /content
425425
426426
Now it should be possible to load in the above fixtures:
427427

reference/configuration/block.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ configured under the ``cmf_block`` key in your application configuration. When
66
using XML, you can use the ``http://cmf.symfony.com/schema/dic/block``
77
namespace.
88

9+
The BlockBundle *automatically* changes some defaults and adds configuration
10+
to the SonataBlockBundle to make it work nicely. See the
11+
:ref:`updated SonataBlockBundle defaults <bundle-block-updated-sonata-defaults>`.
12+
913
Configuration
1014
-------------
1115

0 commit comments

Comments
 (0)