<?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/service.html.twig */
class __TwigTemplate_470229e27f9577b95e103f012c6a4e8e 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/service.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/service.html.twig"));
// line 6
echo "
";
// line 8
$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.', 8, $this->source); })()), "getProperty", [0 => "navigation-root-service"], "method", false, false, true, 8);
// line 9
echo "
";
// line 10
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.', 10, $this->source); })()), "\\Pimcore\\Model\\Document\\Folder") && !$this->env->getTest('instanceof')->getCallable()((isset($context["navStartNode"]) || array_key_exists("navStartNode", $context) ? $context["navStartNode"] : (function () { throw new RuntimeError('Variable "navStartNode" does not exist.', 10, $this->source); })()), "\\Pimcore\\Model\\Document\\Page"))) {
// line 11
echo "\t";
$context["navStartNode"] = Pimcore\Model\Document::getById(1);
}
// line 13
echo "
";
// line 14
$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.', 14, $this->source); })()), 14, $this->source), $this->sandbox->ensureToStringAllowed((isset($context["navStartNode"]) || array_key_exists("navStartNode", $context) ? $context["navStartNode"] : (function () { throw new RuntimeError('Variable "navStartNode" does not exist.', 14, $this->source); })()), 14, $this->source));
// line 15
$context["menuRenderer"] = $this->env->getFunction('pimcore_nav_renderer')->getCallable()("menu");
// line 16
ob_start();
// line 17
echo "
\t";
// line 18
$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.', 18, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["page"]) {
// line 19
echo "\t\t";
if (((twig_get_attribute($this->env, $this->source, $context["page"], "isVisible", [], "method", false, false, true, 19) && 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.', 19, $this->source); })()), "accept", [0 => $context["page"]], "method", false, false, true, 19)) && !twig_get_attribute($this->env, $this->source, $context["page"], "getCustomSetting", [0 => "navigationItemVirtual"], "method", false, false, true, 19))) {
// line 20
echo "\t\t\t";
$context["activeClass"] = ((twig_get_attribute($this->env, $this->source, $context["page"], "getActive", [0 => true], "method", false, false, true, 20)) ? ("navigation__item--active") : (""));
// line 21
echo "\t\t\t<li class=\"navigation__item ";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["activeClass"]) || array_key_exists("activeClass", $context) ? $context["activeClass"] : (function () { throw new RuntimeError('Variable "activeClass" does not exist.', 21, $this->source); })()), 21, $this->source), "html", null, true);
echo "\">
\t\t\t\t<a href=\"";
// line 22
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["page"], "getHref", [], "method", false, false, true, 22), 22, $this->source), "html", null, true);
echo "\"
\t\t\t\t class=\"navigation__link\"
\t\t\t\t target=\"";
// line 24
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["page"], "getTarget", [], "method", false, false, true, 24), 24, $this->source), "html", null, true);
echo "\"
\t\t\t\t aria-label=\"";
// line 25
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["page"], "getLabel", [], "method", false, false, true, 25), 25, $this->source), "html", null, true);
echo "\" ";
if (twig_get_attribute($this->env, $this->source, $context["page"], "getActive", [0 => false], "method", false, false, true, 25)) {
echo "aria-current=\"page\"";
}
echo ">
\t\t\t\t\t";
// line 26
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["page"], "getLabel", [], "method", false, false, true, 26), 26, $this->source), "html", null, true);
echo "
\t\t\t\t</a>
\t\t\t</li>
\t\t";
}
// line 30
echo "\t";
}
$_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 32
echo "
<nav class=\"navigation navigation--";
// line 33
echo twig_escape_filter($this->env, ((array_key_exists("class", $context)) ? (_twig_default_filter($this->sandbox->ensureToStringAllowed((isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new RuntimeError('Variable "class" does not exist.', 33, $this->source); })()), 33, $this->source), "service")) : ("service")), "html", null, true);
echo "\" aria-label=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("wcag.label.navigation-service"), "html", null, true);
echo "\">
\t<ul class=\"navigation__container\">
\t\t";
// line 35
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.', 35, $this->source); })()), 35, $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/service.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 127 => 35, 120 => 33, 117 => 32, 110 => 30, 103 => 26, 95 => 25, 91 => 24, 86 => 22, 81 => 21, 78 => 20, 75 => 19, 71 => 18, 68 => 17, 66 => 16, 64 => 15, 62 => 14, 59 => 13, 55 => 11, 53 => 10, 50 => 9, 48 => 8, 45 => 6,);
}
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-service') %}
{% if not navStartNode is instanceof('\\\\Pimcore\\\\Model\\\\Document\\\\Folder') and not navStartNode is instanceof('\\\\Pimcore\\\\Model\\\\Document\\\\Page')%}
\t{% set navStartNode = pimcore_document(1) %}
{% endif %}
{% set mainNavigation = custom_build_nav(document, navStartNode) %}
{% set menuRenderer = pimcore_nav_renderer('menu') %}
{% set content %}
\t{% for page in mainNavigation %}
\t\t{% if page.isVisible() and menuRenderer.accept(page) and not page.getCustomSetting('navigationItemVirtual') %}
\t\t\t{% set activeClass = page.getActive(true) ? 'navigation__item--active' : '' %}
\t\t\t<li class=\"navigation__item {{ activeClass }}\">
\t\t\t\t<a href=\"{{ page.getHref() }}\"
\t\t\t\t class=\"navigation__link\"
\t\t\t\t target=\"{{ page.getTarget() }}\"
\t\t\t\t aria-label=\"{{ page.getLabel() }}\" {% if page.getActive(false) %}aria-current=\"page\"{% endif %}>
\t\t\t\t\t{{ page.getLabel() }}
\t\t\t\t</a>
\t\t\t</li>
\t\t{% endif %}
\t{% endfor %}
{% endset %}
<nav class=\"navigation navigation--{{ class|default('service') }}\" aria-label=\"{{ 'wcag.label.navigation-service'|trans }}\">
\t<ul class=\"navigation__container\">
\t\t{{ content }}
\t</ul>
</nav>", "navigation/service.html.twig", "/var/www/snr/staging.nuernberger-bratwuerste.de/templates/navigation/service.html.twig");
}
public function checkSecurity()
{
static $tags = array("set" => 8, "if" => 10, "for" => 18);
static $filters = array("escape" => 21, "default" => 33, "trans" => 33);
static $functions = array("pimcore_document" => 11, "custom_build_nav" => 14, "pimcore_nav_renderer" => 15);
try {
$this->sandbox->checkSecurity(
['set', 'if', 'for'],
['escape', 'default', '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;
}
}
}