var/cache/dev/twig/72/72b5b9ca9e70576ee9779fd280fa4ad7.php line 33

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\SandboxExtension;
  6. use Twig\Markup;
  7. use Twig\Sandbox\SecurityError;
  8. use Twig\Sandbox\SecurityNotAllowedTagError;
  9. use Twig\Sandbox\SecurityNotAllowedFilterError;
  10. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  11. use Twig\Source;
  12. use Twig\Template;
  13. /* layout/nav/main-mobile.html.twig */
  14. class __TwigTemplate_d4bb26e375bfa0965eb6db9502b00b68 extends Template
  15. {
  16.     private $source;
  17.     private $macros = [];
  18.     public function __construct(Environment $env)
  19.     {
  20.         parent::__construct($env);
  21.         $this->source $this->getSourceContext();
  22.         $this->parent false;
  23.         $this->blocks = [
  24.         ];
  25.     }
  26.     protected function doDisplay(array $context, array $blocks = [])
  27.     {
  28.         $macros $this->macros;
  29.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  30.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""layout/nav/main-mobile.html.twig"));
  31.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  32.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""layout/nav/main-mobile.html.twig"));
  33.         // line 1
  34.         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); })()))) {
  35.             // line 2
  36.             echo "    ";
  37.             $context["document"] = Pimcore\Model\Document::getById(1);
  38.         }
  39.         // line 4
  40.         echo "
  41. ";
  42.         // line 5
  43.         $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", [=> "mainNavStartNode"], "method"falsefalsefalse5);
  44.         // line 6
  45.         echo "
  46. ";
  47.         // line 7
  48.         if ( !(($this->env->getTest('instanceof')->getCallable()(        // line 8
  49. (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
  50. (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
  51. (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"))) {
  52.             // line 12
  53.             echo "    ";
  54.             $context["navStartNode"] = Pimcore\Model\Document::getById(1);
  55.         }
  56.         // line 14
  57.         echo "
  58. ";
  59.         // line 15
  60.         $context["mainNavigation"] = $this->env->getFunction('pimcore_build_nav')->getCallable()(["active" =>         // line 16
  61. (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
  62. (isset($context["navStartNode"]) || array_key_exists("navStartNode"$context) ? $context["navStartNode"] : (function () { throw new RuntimeError('Variable "navStartNode" does not exist.'17$this->source); })())]);
  63.         // line 19
  64.         echo "
  65. ";
  66.         // line 20
  67.         $context["menuRenderer"] = $this->env->getFunction('pimcore_nav_renderer')->getCallable()("menu");
  68.         // line 21
  69.         echo "
  70. ";
  71.         // line 22
  72.         $context['_parent'] = $context;
  73.         $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); })()));
  74.         $context['loop'] = [
  75.           'parent' => $context['_parent'],
  76.           'index0' => 0,
  77.           'index'  => 1,
  78.           'first'  => true,
  79.         ];
  80.         if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
  81.             $length count($context['_seq']);
  82.             $context['loop']['revindex0'] = $length 1;
  83.             $context['loop']['revindex'] = $length;
  84.             $context['loop']['length'] = $length;
  85.             $context['loop']['last'] = === $length;
  86.         }
  87.         foreach ($context['_seq'] as $context["_key"] => $context["page"]) {
  88.             // line 23
  89.             echo "    ";
  90.             if ((twig_get_attribute($this->env$this->source$context["page"], "isVisible", [], "method"falsefalsefalse23) && 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", [=> $context["page"]], "method"falsefalsefalse23))) {
  91.                 // line 24
  92.                 echo "
  93.         ";
  94.                 // line 26
  95.                 echo "        ";
  96.                 $context["hasChildren"] = false;
  97.                 // line 27
  98.                 echo "
  99.         ";
  100.                 // line 28
  101.                 $context['_parent'] = $context;
  102.                 $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env$this->source$context["page"], "pages", [], "any"falsefalsefalse28));
  103.                 foreach ($context['_seq'] as $context["_key"] => $context["child"]) {
  104.                     // line 29
  105.                     echo "            ";
  106.                     if (twig_get_attribute($this->env$this->source$context["child"], "_visible", [], "any"falsefalsefalse29)) {
  107.                         // line 30
  108.                         echo "                ";
  109.                         $context["hasChildren"] = true;
  110.                         // line 31
  111.                         echo "            ";
  112.                     }
  113.                     // line 32
  114.                     echo "        ";
  115.                 }
  116.                 $_parent $context['_parent'];
  117.                 unset($context['_seq'], $context['_iterated'], $context['_key'], $context['child'], $context['_parent'], $context['loop']);
  118.                 $context array_intersect_key($context$_parent) + $_parent;
  119.                 // line 33
  120.                 echo "
  121.         ";
  122.                 // line 35
  123.                 echo "        ";
  124.                 if (twig_get_attribute($this->env$this->source$context["page"], "_active", [], "any"falsefalsefalse35)) {
  125.                     // line 36
  126.                     echo "            ";
  127.                     $context["activeClass"] = "active";
  128.                     // line 37
  129.                     echo "        ";
  130.                 } else {
  131.                     // line 38
  132.                     echo "            ";
  133.                     $context["activeClass"] = "";
  134.                     // line 39
  135.                     echo "        ";
  136.                 }
  137.                 // line 40
  138.                 echo "
  139.         ";
  140.                 // line 42
  141.                 echo "        ";
  142.                 $context["activeButtonClass"] = "";
  143.                 // line 43
  144.                 echo "
  145.         ";
  146.                 // line 45
  147.                 echo "        ";
  148.                 if ((twig_get_attribute($this->env$this->source$context["page"], "_active", [], "any"falsefalsefalse45) && (isset($context["hasChildren"]) || array_key_exists("hasChildren"$context) ? $context["hasChildren"] : (function () { throw new RuntimeError('Variable "hasChildren" does not exist.'45$this->source); })()))) {
  149.                     // line 46
  150.                     echo "            ";
  151.                     $context["activeButtonClass"] = "active";
  152.                     // line 47
  153.                     echo "        ";
  154.                 }
  155.                 // line 48
  156.                 echo "
  157.         ";
  158.                 // line 49
  159.                 if ( !(isset($context["hasChildren"]) || array_key_exists("hasChildren"$context) ? $context["hasChildren"] : (function () { throw new RuntimeError('Variable "hasChildren" does not exist.'49$this->source); })())) {
  160.                     // line 50
  161.                     echo "            <li class=\"";
  162.                     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"nulltrue);
  163.                     echo "\">
  164.                 <a href=\"";
  165.                     // line 51
  166.                     echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["page"], "getHref", [], "method"falsefalsefalse51), "html"nulltrue);
  167.                     echo "\">";
  168.                     echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["page"], "getLabel", [], "method"falsefalsefalse51), "html"nulltrue);
  169.                     echo "</a>
  170.             </li>
  171.         ";
  172.                 } else {
  173.                     // line 54
  174.                     echo "            <li class=\"";
  175.                     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"nulltrue);
  176.                     echo "\">
  177.                 <a href=\"";
  178.                     // line 56
  179.                     echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["page"], "getHref", [], "method"falsefalsefalse56), "html"nulltrue);
  180.                     echo "\">";
  181.                     echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["page"], "getLabel", [], "method"falsefalsefalse56), "html"nulltrue);
  182.                     echo "</a>
  183.                 <div class=\"subnav-toggler\" data-subnav=\"";
  184.                     // line 58
  185.                     echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["page"], "id", [], "any"falsefalsefalse58), "html"nulltrue);
  186.                     echo "\">
  187.                     ";
  188.                     // line 59
  189.                     echo twig_include($this->env$context"svg/header/mobile/accordion.html.twig");
  190.                     echo "
  191.                 </div>
  192.             </li>
  193.         ";
  194.                 }
  195.                 // line 64
  196.                 echo "
  197.     ";
  198.             }
  199.             ++$context['loop']['index0'];
  200.             ++$context['loop']['index'];
  201.             $context['loop']['first'] = false;
  202.             if (isset($context['loop']['length'])) {
  203.                 --$context['loop']['revindex0'];
  204.                 --$context['loop']['revindex'];
  205.                 $context['loop']['last'] = === $context['loop']['revindex0'];
  206.             }
  207.         }
  208.         $_parent $context['_parent'];
  209.         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['page'], $context['_parent'], $context['loop']);
  210.         $context array_intersect_key($context$_parent) + $_parent;
  211.         
  212.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  213.         
  214.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  215.     }
  216.     public function getTemplateName()
  217.     {
  218.         return "layout/nav/main-mobile.html.twig";
  219.     }
  220.     public function isTraitable()
  221.     {
  222.         return false;
  223.     }
  224.     public function getDebugInfo()
  225.     {
  226.         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,);
  227.     }
  228.     public function getSourceContext()
  229.     {
  230.         return new Source("{% if not document is defined or not document %}
  231.     {% set document = pimcore_document(1) %}
  232. {% endif %}
  233. {% set navStartNode = document.getProperty('mainNavStartNode') %}
  234. {% if not 
  235.     (navStartNode is instanceof('\\\\Pimcore\\\\Model\\\\Document\\\\Page') 
  236.     or navStartNode is instanceof('\\\\Pimcore\\\\Model\\\\Document\\\\Folder')
  237.     or navStartNode is instanceof('\\\\Pimcore\\\\Model\\\\Document\\\\Link')
  238. ) %}
  239.     {% set navStartNode = pimcore_document(1) %}
  240. {% endif %}
  241. {% set mainNavigation = pimcore_build_nav({
  242.     active: document,
  243.     root: navStartNode
  244. }) %}
  245. {% set menuRenderer = pimcore_nav_renderer('menu') %}
  246. {% for page in mainNavigation %}
  247.     {% if page.isVisible() and menuRenderer.accept(page)  %}
  248.         {# has children #}
  249.         {% set hasChildren = false %}
  250.         {% for child in page.pages %}
  251.             {% if child._visible %}
  252.                 {% set hasChildren = true %}
  253.             {% endif %}
  254.         {% endfor %}
  255.         {# active #}
  256.         {% if page._active %}
  257.             {% set activeClass = 'active' %}
  258.         {% else %}
  259.             {% set activeClass = '' %}
  260.         {% endif %}
  261.         {# inactive or active with no children #}
  262.         {% set activeButtonClass = '' %}
  263.         {# active and has children #}
  264.         {% if page._active and hasChildren %}
  265.             {% set activeButtonClass = 'active' %}
  266.         {% endif %}
  267.         {% if not hasChildren %}
  268.             <li class=\"{{ activeClass }}\">
  269.                 <a href=\"{{ page.getHref() }}\">{{ page.getLabel() }}</a>
  270.             </li>
  271.         {% else %}
  272.             <li class=\"{{ activeClass }}\">
  273.                 <a href=\"{{ page.getHref() }}\">{{ page.getLabel() }}</a>
  274.                 <div class=\"subnav-toggler\" data-subnav=\"{{ page.id }}\">
  275.                     {{ include('svg/header/mobile/accordion.html.twig') }}
  276.                 </div>
  277.             </li>
  278.         {% endif %}
  279.     {% endif %}
  280. {% endfor %}""layout/nav/main-mobile.html.twig""/home/httpd/vhosts/a4interactive.ch/httpdocs/lutisbach.a4interactive.ch/templates/layout/nav/main-mobile.html.twig");
  281.     }
  282. }