<?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;
/* layout/nav/main-mobile.html.twig */
class __TwigTemplate_d4bb26e375bfa0965eb6db9502b00b68 extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->parent = false;
$this->blocks = [
];
}
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", "layout/nav/main-mobile.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "layout/nav/main-mobile.html.twig"));
// line 1
if (( !array_key_exists("document", $context) || !(isset($context["document"]) || array_key_exists("document", $context) ? $context["document"] : (function () { throw new RuntimeError('Variable "document" does not exist.', 1, $this->source); })()))) {
// line 2
echo " ";
$context["document"] = Pimcore\Model\Document::getById(1);
}
// line 4
echo "
";
// line 5
$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.', 5, $this->source); })()), "getProperty", [0 => "mainNavStartNode"], "method", false, false, false, 5);
// line 6
echo "
";
// line 7
if ( !(($this->env->getTest('instanceof')->getCallable()( // line 8
(isset($context["navStartNode"]) || array_key_exists("navStartNode", $context) ? $context["navStartNode"] : (function () { throw new RuntimeError('Variable "navStartNode" does not exist.', 8, $this->source); })()), "\\Pimcore\\Model\\Document\\Page") || $this->env->getTest('instanceof')->getCallable()( // line 9
(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\\Folder")) || $this->env->getTest('instanceof')->getCallable()( // line 10
(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\\Link"))) {
// line 12
echo " ";
$context["navStartNode"] = Pimcore\Model\Document::getById(1);
}
// line 14
echo "
";
// line 15
$context["mainNavigation"] = $this->env->getFunction('pimcore_build_nav')->getCallable()(["active" => // line 16
(isset($context["document"]) || array_key_exists("document", $context) ? $context["document"] : (function () { throw new RuntimeError('Variable "document" does not exist.', 16, $this->source); })()), "root" => // line 17
(isset($context["navStartNode"]) || array_key_exists("navStartNode", $context) ? $context["navStartNode"] : (function () { throw new RuntimeError('Variable "navStartNode" does not exist.', 17, $this->source); })())]);
// line 19
echo "
";
// line 20
$context["menuRenderer"] = $this->env->getFunction('pimcore_nav_renderer')->getCallable()("menu");
// line 21
echo "
";
// line 22
$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.', 22, $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 23
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["page"], "isVisible", [], "method", false, false, false, 23) && 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.', 23, $this->source); })()), "accept", [0 => $context["page"]], "method", false, false, false, 23))) {
// line 24
echo "
";
// line 26
echo " ";
$context["hasChildren"] = false;
// line 27
echo "
";
// line 28
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, $context["page"], "pages", [], "any", false, false, false, 28));
foreach ($context['_seq'] as $context["_key"] => $context["child"]) {
// line 29
echo " ";
if (twig_get_attribute($this->env, $this->source, $context["child"], "_visible", [], "any", false, false, false, 29)) {
// line 30
echo " ";
$context["hasChildren"] = true;
// line 31
echo " ";
}
// line 32
echo " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['child'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 33
echo "
";
// line 35
echo " ";
if (twig_get_attribute($this->env, $this->source, $context["page"], "_active", [], "any", false, false, false, 35)) {
// line 36
echo " ";
$context["activeClass"] = "active";
// line 37
echo " ";
} else {
// line 38
echo " ";
$context["activeClass"] = "";
// line 39
echo " ";
}
// line 40
echo "
";
// line 42
echo " ";
$context["activeButtonClass"] = "";
// line 43
echo "
";
// line 45
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["page"], "_active", [], "any", false, false, false, 45) && (isset($context["hasChildren"]) || array_key_exists("hasChildren", $context) ? $context["hasChildren"] : (function () { throw new RuntimeError('Variable "hasChildren" does not exist.', 45, $this->source); })()))) {
// line 46
echo " ";
$context["activeButtonClass"] = "active";
// line 47
echo " ";
}
// line 48
echo "
";
// line 49
if ( !(isset($context["hasChildren"]) || array_key_exists("hasChildren", $context) ? $context["hasChildren"] : (function () { throw new RuntimeError('Variable "hasChildren" does not exist.', 49, $this->source); })())) {
// line 50
echo " <li class=\"";
echo twig_escape_filter($this->env, (isset($context["activeClass"]) || array_key_exists("activeClass", $context) ? $context["activeClass"] : (function () { throw new RuntimeError('Variable "activeClass" does not exist.', 50, $this->source); })()), "html", null, true);
echo "\">
<a href=\"";
// line 51
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["page"], "getHref", [], "method", false, false, false, 51), "html", null, true);
echo "\">";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["page"], "getLabel", [], "method", false, false, false, 51), "html", null, true);
echo "</a>
</li>
";
} else {
// line 54
echo " <li class=\"";
echo twig_escape_filter($this->env, (isset($context["activeClass"]) || array_key_exists("activeClass", $context) ? $context["activeClass"] : (function () { throw new RuntimeError('Variable "activeClass" does not exist.', 54, $this->source); })()), "html", null, true);
echo "\">
<a href=\"";
// line 56
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["page"], "getHref", [], "method", false, false, false, 56), "html", null, true);
echo "\">";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["page"], "getLabel", [], "method", false, false, false, 56), "html", null, true);
echo "</a>
<div class=\"subnav-toggler\" data-subnav=\"";
// line 58
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["page"], "id", [], "any", false, false, false, 58), "html", null, true);
echo "\">
";
// line 59
echo twig_include($this->env, $context, "svg/header/mobile/accordion.html.twig");
echo "
</div>
</li>
";
}
// line 64
echo "
";
}
++$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;
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
public function getTemplateName()
{
return "layout/nav/main-mobile.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 208 => 64, 200 => 59, 196 => 58, 189 => 56, 183 => 54, 175 => 51, 170 => 50, 168 => 49, 165 => 48, 162 => 47, 159 => 46, 156 => 45, 153 => 43, 150 => 42, 147 => 40, 144 => 39, 141 => 38, 138 => 37, 135 => 36, 132 => 35, 129 => 33, 123 => 32, 120 => 31, 117 => 30, 114 => 29, 110 => 28, 107 => 27, 104 => 26, 101 => 24, 98 => 23, 81 => 22, 78 => 21, 76 => 20, 73 => 19, 71 => 17, 70 => 16, 69 => 15, 66 => 14, 62 => 12, 60 => 10, 59 => 9, 58 => 8, 57 => 7, 54 => 6, 52 => 5, 49 => 4, 45 => 2, 43 => 1,);
}
public function getSourceContext()
{
return new Source("{% if not document is defined or not document %}
{% set document = pimcore_document(1) %}
{% endif %}
{% set navStartNode = document.getProperty('mainNavStartNode') %}
{% if not
(navStartNode is instanceof('\\\\Pimcore\\\\Model\\\\Document\\\\Page')
or navStartNode is instanceof('\\\\Pimcore\\\\Model\\\\Document\\\\Folder')
or navStartNode is instanceof('\\\\Pimcore\\\\Model\\\\Document\\\\Link')
) %}
{% set navStartNode = pimcore_document(1) %}
{% endif %}
{% set mainNavigation = pimcore_build_nav({
active: document,
root: navStartNode
}) %}
{% set menuRenderer = pimcore_nav_renderer('menu') %}
{% for page in mainNavigation %}
{% if page.isVisible() and menuRenderer.accept(page) %}
{# has children #}
{% set hasChildren = false %}
{% for child in page.pages %}
{% if child._visible %}
{% set hasChildren = true %}
{% endif %}
{% endfor %}
{# active #}
{% if page._active %}
{% set activeClass = 'active' %}
{% else %}
{% set activeClass = '' %}
{% endif %}
{# inactive or active with no children #}
{% set activeButtonClass = '' %}
{# active and has children #}
{% if page._active and hasChildren %}
{% set activeButtonClass = 'active' %}
{% endif %}
{% if not hasChildren %}
<li class=\"{{ activeClass }}\">
<a href=\"{{ page.getHref() }}\">{{ page.getLabel() }}</a>
</li>
{% else %}
<li class=\"{{ activeClass }}\">
<a href=\"{{ page.getHref() }}\">{{ page.getLabel() }}</a>
<div class=\"subnav-toggler\" data-subnav=\"{{ page.id }}\">
{{ include('svg/header/mobile/accordion.html.twig') }}
</div>
</li>
{% endif %}
{% endif %}
{% endfor %}", "layout/nav/main-mobile.html.twig", "/home/httpd/vhosts/a4interactive.ch/httpdocs/lutisbach.a4interactive.ch/templates/layout/nav/main-mobile.html.twig");
}
}