<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
/* navigation/primary.html.twig */
class __TwigTemplate_0d4f14fe555b4271897912dad89f6223 extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->parent = false;
$this->blocks = [
];
$this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension');
$this->checkSecurity();
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "navigation/primary.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "navigation/primary.html.twig"));
// line 7
$context["navStartNode"] = twig_get_attribute($this->env, $this->source, (isset($context["document"]) || array_key_exists("document", $context) ? $context["document"] : (function () { throw new RuntimeError('Variable "document" does not exist.', 7, $this->source); })()), "getProperty", [0 => "navigation-root-primary"], "method", false, false, true, 7);
// line 8
echo "
";
// line 9
if (( !$this->env->getTest('instanceof')->getCallable()((isset($context["navStartNode"]) || array_key_exists("navStartNode", $context) ? $context["navStartNode"] : (function () { throw new RuntimeError('Variable "navStartNode" does not exist.', 9, $this->source); })()), "\\Pimcore\\Model\\Document\\Link") && !$this->env->getTest('instanceof')->getCallable()((isset($context["navStartNode"]) || array_key_exists("navStartNode", $context) ? $context["navStartNode"] : (function () { throw new RuntimeError('Variable "navStartNode" does not exist.', 9, $this->source); })()), "\\Pimcore\\Model\\Document\\Page"))) {
// line 10
echo "\t";
$context["navStartNode"] = Pimcore\Model\Document::getById(1);
}
// line 12
echo "
";
// line 13
$context["mainNavigation"] = $this->extensions['App\Twig\Extension\NavigationExtension']->getCustomNavigation($this->sandbox->ensureToStringAllowed((isset($context["document"]) || array_key_exists("document", $context) ? $context["document"] : (function () { throw new RuntimeError('Variable "document" does not exist.', 13, $this->source); })()), 13, $this->source), $this->sandbox->ensureToStringAllowed((isset($context["navStartNode"]) || array_key_exists("navStartNode", $context) ? $context["navStartNode"] : (function () { throw new RuntimeError('Variable "navStartNode" does not exist.', 13, $this->source); })()), 13, $this->source));
// line 14
$context["home"] = (isset($context["navStartNode"]) || array_key_exists("navStartNode", $context) ? $context["navStartNode"] : (function () { throw new RuntimeError('Variable "navStartNode" does not exist.', 14, $this->source); })());
// line 15
echo "
";
// line 30
$context["menuRenderer"] = $this->env->getFunction('pimcore_nav_renderer')->getCallable()("menu");
// line 31
ob_start();
// line 32
echo "\t";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["mainNavigation"]) || array_key_exists("mainNavigation", $context) ? $context["mainNavigation"] : (function () { throw new RuntimeError('Variable "mainNavigation" does not exist.', 32, $this->source); })()));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["page"]) {
// line 33
echo "\t\t";
// line 34
echo "\t\t";
if (((twig_get_attribute($this->env, $this->source, $context["page"], "isVisible", [], "method", false, false, true, 34) && twig_get_attribute($this->env, $this->source, (isset($context["menuRenderer"]) || array_key_exists("menuRenderer", $context) ? $context["menuRenderer"] : (function () { throw new RuntimeError('Variable "menuRenderer" does not exist.', 34, $this->source); })()), "accept", [0 => $context["page"]], "method", false, false, true, 34)) && !twig_get_attribute($this->env, $this->source, $context["page"], "getCustomSetting", [0 => "navigationItemVirtual"], "method", false, false, true, 34))) {
// line 35
echo "\t\t\t";
$context["activeClassItem"] = ((twig_get_attribute($this->env, $this->source, $context["page"], "getActive", [0 => true], "method", false, false, true, 35)) ? ("navigation__item--active") : (""));
// line 36
echo "\t\t\t<li class=\"navigation__item navigation__item--first ";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["activeClassItem"]) || array_key_exists("activeClassItem", $context) ? $context["activeClassItem"] : (function () { throw new RuntimeError('Variable "activeClassItem" does not exist.', 36, $this->source); })()), 36, $this->source), "html", null, true);
echo " \">
\t\t\t\t";
// line 37
$this->loadTemplate("navigation/partials/primary-link.html.twig", "navigation/primary.html.twig", 37)->display(twig_array_merge($context, ["page" => $context["page"], "classes" => [0 => "navigation__link--first"]]));
// line 38
echo "\t\t\t\t";
if (twig_get_attribute($this->env, $this->source, $context["page"], "hasVisiblePages", [], "method", false, false, true, 38)) {
// line 39
echo "\t\t\t\t\t";
$context["children"] = twig_get_attribute($this->env, $this->source, $context["page"], "getPages", [], "method", false, false, true, 39);
// line 40
echo "\t\t\t\t\t<ul class=\"navigation__container navigation__container--second\">
\t\t\t\t\t";
// line 41
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["children"]) || array_key_exists("children", $context) ? $context["children"] : (function () { throw new RuntimeError('Variable "children" does not exist.', 41, $this->source); })()));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["childPage"]) {
// line 42
echo "\t\t\t\t\t\t";
if (((twig_get_attribute($this->env, $this->source, $context["childPage"], "isVisible", [], "method", false, false, true, 42) && twig_get_attribute($this->env, $this->source, (isset($context["menuRenderer"]) || array_key_exists("menuRenderer", $context) ? $context["menuRenderer"] : (function () { throw new RuntimeError('Variable "menuRenderer" does not exist.', 42, $this->source); })()), "accept", [0 => $context["childPage"]], "method", false, false, true, 42)) && !twig_get_attribute($this->env, $this->source, $context["childPage"], "getCustomSetting", [0 => "navigationItemVirtual"], "method", false, false, true, 42))) {
// line 43
echo "\t\t\t\t\t\t\t";
$context["activeClassChildItem"] = ((twig_get_attribute($this->env, $this->source, $context["childPage"], "getActive", [0 => true], "method", false, false, true, 43)) ? ("navigation__item--active") : (""));
// line 44
echo "\t\t\t\t\t\t\t<li class=\"navigation__item navigation__item--second ";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["activeClassChildItem"]) || array_key_exists("activeClassChildItem", $context) ? $context["activeClassChildItem"] : (function () { throw new RuntimeError('Variable "activeClassChildItem" does not exist.', 44, $this->source); })()), 44, $this->source), "html", null, true);
echo " \">
\t\t\t\t\t\t\t\t";
// line 45
$this->loadTemplate("navigation/partials/primary-link.html.twig", "navigation/primary.html.twig", 45)->display(twig_array_merge($context, ["page" => $context["childPage"], "classes" => [0 => "navigation__link--second"], "icon" => "harke"]));
// line 46
echo "\t\t\t\t\t\t\t</li>
\t\t\t\t\t\t";
}
// line 48
echo "\t\t\t\t\t";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['childPage'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 49
echo "\t\t\t\t\t</ul>
\t\t\t\t";
}
// line 51
echo "\t\t\t</li>
\t\t";
}
// line 53
echo "\t";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['page'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
$context["content"] = ('' === $tmp = ob_get_clean()) ? '' : new Markup($tmp, $this->env->getCharset());
// line 55
echo "
<nav class=\"navigation navigation--primary\" aria-label=\"";
// line 56
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("wcag.label.navigation-primary"), "html", null, true);
echo "\" id=\"clickable-navigation\">
\t<ul class=\"navigation__container navigation__container--first clickable-navigation\">
\t\t";
// line 58
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["content"]) || array_key_exists("content", $context) ? $context["content"] : (function () { throw new RuntimeError('Variable "content" does not exist.', 58, $this->source); })()), 58, $this->source), "html", null, true);
echo "
\t</ul>
</nav>
";
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
public function getTemplateName()
{
return "navigation/primary.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 191 => 58, 186 => 56, 183 => 55, 168 => 53, 164 => 51, 160 => 49, 146 => 48, 142 => 46, 140 => 45, 135 => 44, 132 => 43, 129 => 42, 112 => 41, 109 => 40, 106 => 39, 103 => 38, 101 => 37, 96 => 36, 93 => 35, 90 => 34, 88 => 33, 70 => 32, 68 => 31, 66 => 30, 63 => 15, 61 => 14, 59 => 13, 56 => 12, 52 => 10, 50 => 9, 47 => 8, 45 => 7,);
}
public function getSourceContext()
{
return new Source("{#
project: Pimcore - Schutzverband Nuernberg Rostbratwuerste
User: erikb
Year: 2022
#}
{# get the document which should be used to start in navigation | default home #}
{% set navStartNode = document.getProperty('navigation-root-primary') %}
{% if not navStartNode is instanceof('\\\\Pimcore\\\\Model\\\\Document\\\\Link') and not navStartNode is instanceof('\\\\Pimcore\\\\Model\\\\Document\\\\Page')%}
\t{% set navStartNode = pimcore_document(1) %}
{% endif %}
{% set mainNavigation = custom_build_nav(document, navStartNode) %}
{% set home = navStartNode %}
{#
order: put it in front of all the others
uri: path to homepage
label: visible label
title: tooltip text
active: active state (boolean)
#}
{# do mainNavigation.addPage({
\torder: -1,
\turi: ('/' ~ document.getProperty('language')),
\tlabel: 'Home' | trans,
\ttitle: 'Home' | trans,
\tactive: (document.id == navStartNode.id or document.id == 1)
}) #}
{% set menuRenderer = pimcore_nav_renderer('menu') %}
{% set content %}
\t{% for page in mainNavigation %}
\t\t{# here need to manually check for ACL conditions #}
\t\t{% if page.isVisible() and menuRenderer.accept(page) and not page.getCustomSetting('navigationItemVirtual') %}
\t\t\t{% set activeClassItem = page.getActive(true) ? 'navigation__item--active' : '' %}
\t\t\t<li class=\"navigation__item navigation__item--first {{ activeClassItem }} \">
\t\t\t\t{% include 'navigation/partials/primary-link.html.twig' with { page: page, classes: ['navigation__link--first'] } %}
\t\t\t\t{% if page.hasVisiblePages() %}
\t\t\t\t\t{% set children = page.getPages() %}
\t\t\t\t\t<ul class=\"navigation__container navigation__container--second\">
\t\t\t\t\t{% for childPage in children %}
\t\t\t\t\t\t{% if childPage.isVisible() and menuRenderer.accept(childPage) and not childPage.getCustomSetting('navigationItemVirtual') %}
\t\t\t\t\t\t\t{% set activeClassChildItem = childPage.getActive(true) ? 'navigation__item--active' : '' %}
\t\t\t\t\t\t\t<li class=\"navigation__item navigation__item--second {{ activeClassChildItem }} \">
\t\t\t\t\t\t\t\t{% include 'navigation/partials/primary-link.html.twig' with { page: childPage, classes: ['navigation__link--second'], icon: 'harke' } %}
\t\t\t\t\t\t\t</li>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t{% endfor %}
\t\t\t\t\t</ul>
\t\t\t\t{% endif %}
\t\t\t</li>
\t\t{% endif %}
\t{% endfor %}
{% endset %}
<nav class=\"navigation navigation--primary\" aria-label=\"{{ 'wcag.label.navigation-primary'|trans }}\" id=\"clickable-navigation\">
\t<ul class=\"navigation__container navigation__container--first clickable-navigation\">
\t\t{{ content }}
\t</ul>
</nav>
", "navigation/primary.html.twig", "/var/www/snr/staging.nuernberger-bratwuerste.de/templates/navigation/primary.html.twig");
}
public function checkSecurity()
{
static $tags = array("set" => 7, "if" => 9, "for" => 32, "include" => 37);
static $filters = array("escape" => 36, "trans" => 56);
static $functions = array("pimcore_document" => 10, "custom_build_nav" => 13, "pimcore_nav_renderer" => 30);
try {
$this->sandbox->checkSecurity(
['set', 'if', 'for', 'include'],
['escape', 'trans'],
['pimcore_document', 'custom_build_nav', 'pimcore_nav_renderer']
);
} catch (SecurityError $e) {
$e->setSourceContext($this->source);
if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
$e->setTemplateLine($tags[$e->getTagName()]);
} elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
$e->setTemplateLine($filters[$e->getFilterName()]);
} elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
$e->setTemplateLine($functions[$e->getFunctionName()]);
}
throw $e;
}
}
}