* 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
|
|
@ -126,7 +126,7 @@ class ComponentController extends Controller
|
|||
$rootPage = $repo->find(13);
|
||||
$pages = $repo->getChildrenQueryBuilder($rootPage)
|
||||
->andWhere('IDENTITY(node.country) = '. $country->getId())
|
||||
->setMaxResults(3)
|
||||
->andWhere('node.status > 0')
|
||||
->getQuery()
|
||||
->execute()
|
||||
;
|
||||
|
|
@ -142,7 +142,7 @@ class ComponentController extends Controller
|
|||
$rootPage = $repo->find(2803);
|
||||
$pages = $repo->getChildrenQueryBuilder($rootPage)
|
||||
->andWhere('IDENTITY(node.country) = '. $country->getId())
|
||||
->setMaxResults(3)
|
||||
->andWhere('node.status > 0')
|
||||
->getQuery()
|
||||
->execute()
|
||||
;
|
||||
|
|
@ -152,12 +152,27 @@ class ComponentController extends Controller
|
|||
]);
|
||||
}
|
||||
|
||||
public function offersSidebarWidgetAction(TravelCountry $country)
|
||||
public function offersSidebarWidgetAction(TravelCountry $country = null)
|
||||
{
|
||||
$pages = $this->getEntityManager()->getRepository('AppBundle:Page')->findWithTravelProgramsOfCountry($country);
|
||||
return $this->render('default/components/sidebar/pageSliderSidebarWidget.html.twig', [
|
||||
'slider_title' => 'Angebote',
|
||||
'pages' => $pages
|
||||
'pages' => $this->getOffersByCountry($country),
|
||||
]);
|
||||
}
|
||||
|
||||
public function offersCarouselAction(TravelCountry $country = null)
|
||||
{
|
||||
return $this->render('default/components/multiPageBoxCarousel.html.twig', [
|
||||
'pages' => $this->getOffersByCountry($country),
|
||||
]);
|
||||
}
|
||||
|
||||
private function getOffersByCountry(TravelCountry $country = null)
|
||||
{
|
||||
$repo = $this->getDoctrine()->getRepository('AppBundle:Page');
|
||||
return $country === null
|
||||
? $repo->findOffers()
|
||||
: $repo->findWithTravelProgramsOfCountry($country)
|
||||
;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue