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

Commit 44ef01b

Browse files
committed
Merge pull request #6 from symfony-cmf/standard-block-path
move blocks to standard path
2 parents 52469aa + 8630df2 commit 44ef01b

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

app/config/config.yml

-5
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,6 @@ cmf_routing:
9292
knp_menu:
9393
twig: true
9494

95-
cmf_block:
96-
persistence:
97-
phpcr:
98-
block_basepath: /cms/blocks
99-
10095
sonata_block:
10196
default_contexts: [cms]
10297

src/Acme/DemoBundle/DataFixtures/PHPCR/LoadDemoData.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
namespace Acme\DemoBundle\DataFixtures\PHPCR;
44

5+
use Doctrine\ODM\PHPCR\DocumentManager;
56
use Nelmio\Alice\Fixtures;
67
use Doctrine\Common\Persistence\ObjectManager;
78
use Doctrine\Common\DataFixtures\FixtureInterface;
8-
use Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page;
9+
use PHPCR\Util\NodeHelper;
910
use Symfony\Cmf\Bundle\MenuBundle\Doctrine\Phpcr\MenuNode;
1011

1112
/**
@@ -16,7 +17,7 @@ class LoadDemoData implements FixtureInterface
1617
/**
1718
* Load data fixtures with the passed DocumentManager
1819
*
19-
* @param ObjectManager $manager
20+
* @param DocumentManager $manager
2021
*/
2122
public function load(ObjectManager $manager)
2223
{
@@ -38,6 +39,7 @@ public function load(ObjectManager $manager)
3839
Fixtures::load(array(__DIR__.'/../../Resources/data/pages.yml'), $manager);
3940

4041
// load the blocks
42+
NodeHelper::createPath($manager->getPhpcrSession(), '/cms/content/blocks');
4143
Fixtures::load(array(__DIR__.'/../../Resources/data/blocks.yml'), $manager);
4244

4345
// save the changes
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\ContainerBlock:
22
hero_unit:
3-
id: /cms/blocks/hero_unit
3+
id: /cms/content/blocks/hero_unit
44

55
Acme\DemoBundle\Document\UnitBlock:
66
read_quick_tour:
7-
id: /cms/blocks/hero_unit/quick_tour
7+
id: /cms/content/blocks/hero_unit/quick_tour
88
text: Read the Quick Tour
99
url: http://symfony.com/doc/current/cmf/quick_tour/the_big_picture.html
1010
image: bundles/acmedemo/images/welcome-quick-tour.gif
1111

1212
configure:
13-
id: /cms/blocks/hero_unit/configure
13+
id: /cms/content/blocks/hero_unit/configure
1414
text: Configure
1515
route: _configurator_home
1616
image: bundles/acmedemo/images/welcome-configure.gif
1717

1818
demo:
19-
id: /cms/blocks/hero_unit/demo
19+
id: /cms/content/blocks/hero_unit/demo
2020
text: View the demo
2121
route: /cms/simple/demo
2222
image: bundles/acmedemo/images/welcome-demo.gif

src/Acme/DemoBundle/Resources/views/home.html.twig

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77

88
{% block main %}
99
<div class="row">
10-
{{ sonata_block_render({'name': '/cms/blocks/hero_unit'}) }}
10+
{{ sonata_block_render({'name': '/cms/content/blocks/hero_unit'}) }}
1111
</div>
1212
{% endblock %}

0 commit comments

Comments
 (0)