Skip to content

Commit

Permalink
Fix prepareThemeAssignation duplication with dynamic homeAction.
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed Apr 10, 2015
1 parent c3ff1f2 commit 02bea2f
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions themes/create_theme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,7 @@ multilingual pages.
$translation = $this->bindLocaleFromRoute($request, $_locale);
$this->prepareThemeAssignation(null, $translation);
return $this->render('bar.html.twig', $this->assignation, null, static::getThemeDir());
return $this->render('bar.html.twig', $this->assignation);
}
.. _dynamic-routing:
Expand Down Expand Up @@ -286,15 +285,12 @@ special ajustments.
* Get language from static route
*/
$translation = $this->bindLocaleFromRoute($request, $_locale);
$home = $this->getService('em')->getRepository('RZ\Roadiz\Core\Entities\Node')
->findHomeWithTranslation($translation);
$this->prepareThemeAssignation($home, $translation);
$home = $this->getHome($translation);
/*
* Render Homepage according to its node-type controller
*/
return $this->handle($request);
return $this->handle($request, $home, $translation);
}
Static home
Expand All @@ -318,14 +314,13 @@ the namespace to look into. It becames useful when you mix several themes with t
* Get language from static route
*/
$translation = $this->bindLocaleFromRoute($request, $_locale);
$home = $this->getService('em')->getRepository('RZ\Roadiz\Core\Entities\Node')
->findHomeWithTranslation($translation);
$this->prepareThemeAssignation($home, $translation);
$home = $this->getHome($translation);
/*
* Render Homepage manually
*/
$this->prepareThemeAssignation($home, $translation);
return $this->render('home.html.twig', $this->assignation, null, static::getThemeDir());
}
Expand Down

0 comments on commit 02bea2f

Please sign in to comment.