* Behoben: Angebotsboxen und -Karussells enthalten deaktivierte Reisen

* Sitemap

git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3305 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
uli 2017-02-23 09:08:39 +00:00
parent aeafe245d7
commit b63dcb8b1a
4 changed files with 40 additions and 6 deletions

View file

@ -0,0 +1,18 @@
<ul>
{% for page_node in page_nodes %}
{% set default_url = base_url|default('') ~ '/' ~ page_node.slug %}
<li style="padding-left: 10px;">
<a href="{{ page_node.realUrlPath|default( default_url ) }}">
{{ page_node.title }}
</a>
{% if page_node.__children is not empty %}
{% include 'default/components/sitemap/sitemapNode.html.twig' with {
page_nodes: page_node.__children,
base_url: default_url,
} %}
{% endif %}
</li>
{% endfor %}
</ul>

View file

@ -0,0 +1,5 @@
{% extends get_base_template() %}
{% block body %}
{% include 'default/components/sitemap/sitemapNode.html.twig' %}
{% endblock body %}

View file

@ -214,13 +214,22 @@ class DefaultController extends Controller
->getQuery() ->getQuery()
->execute() ->execute()
; ;
//$rootNodes[0]-> /** @var Page[] $pageNodes Actually no entity objects but associative arrays representing page entities */
/** @var Page $node */ $pageNodes = [];
foreach ($rootNodes as $rootNode) foreach ($rootNodes as $rootNode)
{ {
// #TODO $pageNodes[] = $repo->buildTree($repo->getNodesHierarchyQueryBuilder($rootNode, false, [], true)
$repo->childrenHierarchy($rootNode); ->leftJoin('node.travelProgram', 'tp')
->andWhere('(tp.id IS NULL OR tp.status = 1)')
->andWhere('node.status = 1')
->getQuery()
->getArrayResult()
)[0];
} }
return $this->render('default/pages/sitemap.html.twig', [
'breadcrumb_entries' => [new BreadcrumbEntry('Sitemap')],
'page_nodes' => $pageNodes
]);
} }
/* /*

View file

@ -49,6 +49,8 @@ class PageRepository extends NestedTreeRepository
->innerJoin('node.travelProgram', 'tp') ->innerJoin('node.travelProgram', 'tp')
->innerJoin('tp.countries', 'c') ->innerJoin('tp.countries', 'c')
->where('c.id = '. $country->getId()) ->where('c.id = '. $country->getId())
->andWhere('node.status = 1')
->andWhere('tp.status = 1')
->getQuery() ->getQuery()
->execute() ->execute()
; ;
@ -68,8 +70,8 @@ class PageRepository extends NestedTreeRepository
->addSelect('tp') ->addSelect('tp')
->innerJoin('tp.countries', 'c') ->innerJoin('tp.countries', 'c')
->where('c.id = '. $country->getId()) ->where('c.id = '. $country->getId())
->andWhere('node.status > 0') ->andWhere('node.status = 1')
->andWhere('tp.status > 0') ->andWhere('tp.status = 1')
->orderBy('node.order') ->orderBy('node.order')
->addOrderBy('tp.position') ->addOrderBy('tp.position')
->addOrderBy('node.title') ->addOrderBy('node.title')