* Update auf Twig 2 (notwendig, da block() bei Twig 1 '' statt null zurückgibt. Somit kann nicht unterschieden werden, ob ein Block nicht definiert wurde oder leer ist; das ist wiederum notwendig, damit Templates die Blöcke in sidebar.html.twig auch mit leerem Inhalt überschreiben können)
* Symfony-Update * Behoben: Reisemagazin/-führer Slider zeigt deaktivierte Seiten an; Begrenzung auf 3 Einträge entfernt * Behoben: Angebote werden nicht überall angezeigt * Land einer Seite von übergeordneten Seiten erben (getEffectiveCountry()) * Seitentemplate "offers": Diese Seiten haben unten im Body ein Angebots-Karusell * Templates ohne Controller action werden jetzt unterstützt. Falls keine Action existiert, wird einfach ein gleichnamiges twig-Template gerendert git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3303 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
parent
bf69f20a50
commit
ce292748fb
14 changed files with 662 additions and 288 deletions
|
|
@ -17,6 +17,8 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
|||
* Controller for CMS pages. CMS pages are represented by Page instances (i.e. entries of the page database table).
|
||||
* The template property of a Page object defines the action method below. If a travel program is assigned then the
|
||||
* travelProgramAction is used. If no template is specified, then the defaultAction is used.
|
||||
* If there is no action method, the defaultAction is called and the template name is passed as an argument. A twig
|
||||
* file with this template will be rendered in this case.
|
||||
*
|
||||
* The view templates can be found pages/cms.
|
||||
*
|
||||
|
|
@ -34,9 +36,9 @@ class CmsController extends Controller
|
|||
return $this->getDoctrine()->getManager();
|
||||
}
|
||||
|
||||
public function defaultAction(Page $page)
|
||||
public function defaultAction(Page $page, $template = 'default')
|
||||
{
|
||||
return $this->render('default/pages/cms/default.html.twig', [
|
||||
return $this->render('default/pages/cms/'. $template .'.html.twig', [
|
||||
'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR,
|
||||
'page' => $page,
|
||||
]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue