Skip to content

Commit 087b4f8

Browse files
committed
Merge pull request #243 from ElectricMaxxx/seo-bundle-integration
[WIP] Seo bundle integration
2 parents bc40775 + 65705c8 commit 087b4f8

18 files changed

+382
-54
lines changed

app/AppKernel.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public function registerBundles()
2828
new Symfony\Cmf\Bundle\TreeBrowserBundle\CmfTreeBrowserBundle(),
2929
new Symfony\Cmf\Bundle\BlockBundle\CmfBlockBundle(),
3030
new Symfony\Cmf\Bundle\SimpleCmsBundle\CmfSimpleCmsBundle(),
31+
new Symfony\Cmf\Bundle\SeoBundle\CmfSeoBundle(),
3132
new Liip\SearchBundle\LiipSearchBundle(),
3233
new Symfony\Cmf\Bundle\SearchBundle\CmfSearchBundle(),
3334
new Symfony\Cmf\Bundle\MediaBundle\CmfMediaBundle(),
@@ -51,6 +52,7 @@ public function registerBundles()
5152
new Sonata\CoreBundle\SonataCoreBundle(),
5253
new Sonata\AdminBundle\SonataAdminBundle(),
5354
new Sonata\DoctrinePHPCRAdminBundle\SonataDoctrinePHPCRAdminBundle(),
55+
new Sonata\SeoBundle\SonataSeoBundle(),
5456
new FOS\JsRoutingBundle\FOSJsRoutingBundle(),
5557

5658
// Media support

app/config/config.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ cmf_core:
9595
phpcr:
9696
enabled: true
9797

98+
cmf_content:
99+
persistence:
100+
phpcr:
101+
document_class: Sandbox\MainBundle\Document\DemoSeoContent
102+
98103
cmf_routing:
99104
chain:
100105
routers_by_id:
@@ -118,6 +123,11 @@ cmf_create:
118123
# for demo purposes we are allowing anonymous inline editing
119124
role: IS_AUTHENTICATED_ANONYMOUSLY
120125

126+
cmf_seo:
127+
title: CMF Sandbox - %%content_title%%
128+
description: The Content Management Framework. %%content_description%%
129+
sonata_admin_extension: true
130+
121131
sonata_block:
122132
default_contexts: [cms]
123133
blocks:
@@ -153,6 +163,9 @@ sonata_admin:
153163
cmf_routing.admin_extension.route_referrers:
154164
implements:
155165
- Symfony\Cmf\Component\Routing\RouteReferrersInterface
166+
cmf_seo.admin_extension:
167+
implements:
168+
- Symfony\Cmf\Bundle\SeoBundle\Model\SeoAwareInterface
156169

157170
templates:
158171
# default global templates
@@ -195,7 +208,7 @@ sonata_doctrine_phpcr_admin:
195208
Doctrine\ODM\PHPCR\Document\Generic:
196209
valid_children:
197210
- all
198-
Symfony\Cmf\Bundle\ContentBundle\Doctrine\Phpcr\StaticContent:
211+
Sandbox\MainBundle\Document\DemoSeoContent:
199212
valid_children:
200213
- Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\SimpleBlock
201214
- Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\ContainerBlock
@@ -240,6 +253,14 @@ sonata_doctrine_phpcr_admin:
240253
valid_children:
241254
- Symfony\Cmf\Bundle\MenuBundle\Doctrine\Phpcr\MenuNode
242255

256+
257+
sonata_seo:
258+
page:
259+
title: CMF Sandbox
260+
metas:
261+
name:
262+
keywords: "CMF, Symfony, Routing, Content, PHPCR"
263+
243264
sensio_framework_extra:
244265
view: { annotations: false }
245266
router: { annotations: true }

app/tests/AdminTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ class AdminTest extends WebTestCase
1010
protected $router;
1111

1212
protected $verifiablePatterns = array(
13-
'/cmf/content/staticcontent/list',
14-
'/cmf/content/staticcontent/create',
15-
'/cmf/content/staticcontent/{id}/edit',
16-
'/cmf/content/staticcontent/{id}/delete',
13+
'/sandbox/main/demoseocontent/list',
14+
'/sandbox/main/demoseocontent/create',
15+
'/sandbox/main/demoseocontent/{id}/edit',
16+
'/sandbox/main/demoseocontent/{id}/delete',
1717
'/cmf/block/simpleblock/list',
1818
'/cmf/block/simpleblock/create',
1919
'/cmf/block/simpleblock/{id}/edit',

app/tests/HomepageTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function testContents()
2929
$this->assertCount(1, $crawler->filter('h1:contains(Homepage)'));
3030
$this->assertCount(1, $crawler->filter('h2:contains("Welcome to the Symfony CMF Demo")'));
3131

32-
$menuCount = $this->isSearchSupported() ? 16 : 15;
32+
$menuCount = $this->isSearchSupported() ? 19 : 18;
3333
$this->assertCount($menuCount, $crawler->filter('ul.menu_main li'));
3434
}
3535

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"symfony-cmf/simple-cms-bundle": "1.1.*",
2828
"symfony-cmf/search-bundle": "1.1.*",
2929
"symfony-cmf/create-bundle": "1.1.*",
30+
"symfony-cmf/seo-bundle":"1.0.*",
3031
"jackalope/jackalope-doctrine-dbal": "1.1.*",
3132
"jackalope/jackalope-jackrabbit": "1.1.*",
3233
"doctrine/doctrine-bundle": "1.2.*",

0 commit comments

Comments
 (0)