Skip to content
Browse files

Better blog position in content tree.

  • Loading branch information...
1 parent 44179f9 commit 55b4f616eced9f7699a45123256725323d862cd4 @jakuza jakuza committed
View
2 src/Ideato/PublishingBundle/Controller/BlogController.php
@@ -13,7 +13,7 @@ class BlogController extends Controller
public function indexAction()
{
$dm = $this->container->get('doctrine_phpcr.odm.default_document_manager');
- $node = $dm->find('Ideato\PublishingBundle\Document\BlogPost', '/cms/content/static/blog_a');
+ $node = $dm->find('Ideato\PublishingBundle\Document\BlogPost', '/cms/content/static/blog/blog_a');
$params = array(
'node' => $node
View
6 src/Sandbox/MainBundle/DataFixtures/PHPCR/LoadBlogPostData.php.php
@@ -24,15 +24,15 @@ public function load(ObjectManager $manager)
if (! $this->container) {
throw new \Exception("This does not work without container");
}
- $basepath = $this->container->getParameter('symfony_cmf_content.static_basepath');
+ $blogpath = $this->container->getParameter('symfony_cmf_content.static_basepath').'/blog';
- $this->createPath($basepath);
+ $this->createPath($blogpath);
$yaml = new Parser();
$data = $yaml->parse(file_get_contents(__DIR__ . '/../static/blog.yml'));
foreach($data['blog'] as $overview) {
- $path = $basepath . '/' . $overview['name'];
+ $path = $blogpath . '/' . $overview['name'];
$page = $manager->find(null, $path);
if (! $page) {
$page = new \Ideato\PublishingBundle\Document\BlogPost();
View
6 src/Sandbox/MainBundle/DataFixtures/PHPCR/LoadRoutingData.php
@@ -155,17 +155,17 @@ public function load(ObjectManager $dm)
// class to controller mapping
$class = new Route;
$class->setPosition($parent, 'post');
- $class->setRouteContent($dm->find(null, "$content_path/blog_a"));
+ $class->setRouteContent($dm->find(null, "$content_path/blog/blog_a"));
$dm->persist($class);
$inPrimoPiano = new Route;
$inPrimoPiano->setPosition($parent, 'in-primo-piano');
- $inPrimoPiano->setRouteContent($dm->find(null, "$content_path/blog_a"));
+ $inPrimoPiano->setRouteContent($dm->find(null, "$content_path/blog/blog_a"));
$dm->persist($inPrimoPiano);
$class = new Route;
$class->setPosition($inPrimoPiano, 'git-commit-m-nuovi-corsi-per-ideato-school');
- $class->setRouteContent($dm->find(null, "$content_path/blog_a"));
+ $class->setRouteContent($dm->find(null, "$content_path/blog/blog_a"));
$dm->persist($class);
// class to template mapping is used for all the rest
View
8 src/Sandbox/MainBundle/DataFixtures/static/blog.yml
@@ -31,22 +31,22 @@ blog:
<p>Sonet affert an has. Nam id odio nisl eruditi. Te quo falli propriae delectus, ut animal meliore est, agam decore in sea. Prima debet fierent id sed. Usu debet paulo argumentum ex, solum homero in sed, modus laboramus et usu. Brute legendos contentiones ex pri.
Ut suscipit honestatis sed, per id facer euismod probatus. Ne persius posidonium eum, has elaboraret philosophia eu. No eam wisi choro labores. Sit id oratio aperiam electram, quodsi deterruisset no eum, vel modo quaeque ei</p>
-
+ -
name: "blog_3"
title: "Blog post 3"
content: |
<h2>Aho cioè 3</h2>
-
+ -
name: "blog_4"
title: "Blog post 4"
content: |
<h2>Aho cioè 4</h2>
-
+ -
name: "blog_5"
title: "Blog post 5"
content: |
<h2>Aho cioè 5</h2>
-
+ -
name: "blog_6"
title: "Blog post 6"
content: |

0 comments on commit 55b4f61

Please sign in to comment.
Something went wrong with that request. Please try again.