var/cache/dev/twig/b5/b535140fea875c326edfbe6354eba04f.php line 86

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/head/meta/document.html.twig */
  14. class __TwigTemplate_1cd7266098d02408b9e9122f9e953146 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/head/meta/document.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/head/meta/document.html.twig"));
  33.         // line 2
  34.         if (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.', 2, $this->source); })()), "title", [], "any", false, false, false, 2)) {
  35.             // line 3
  36.             echo "    ";
  37.             twig_get_attribute($this->env, $this->source, $this->env->getFunction('pimcore_head_title')->getCallable()(), "set", [0 => twig_get_attribute($this->env, $this->source, $this->extensions['Twig\Extra\String\StringExtension']->createUnicodeString(twig_replace_filter(twig_striptags(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.', 3, $this->source); })()), "title", [], "any", false, false, false, 3)), ["&shy;" => ""])), "truncate", [0 => 65, 1 => "...", 2 => false], "method", false, false, false, 3)], "method", false, false, false, 3);
  38.             // line 4
  39.             echo "    ";
  40.             if (((isset($context["pagename"]) || array_key_exists("pagename", $context) ? $context["pagename"] : (function () { throw new RuntimeError('Variable "pagename" does not exist.', 4, $this->source); })()) != 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.', 4, $this->source); })()), "title", [], "any", false, false, false, 4))) {
  41.                 // line 5
  42.                 echo "        ";
  43.                 twig_get_attribute($this->env, $this->source, $this->env->getFunction('pimcore_head_title')->getCallable()(), "append", [0 => (isset($context["pagename"]) || array_key_exists("pagename", $context) ? $context["pagename"] : (function () { throw new RuntimeError('Variable "pagename" does not exist.', 5, $this->source); })())], "method", false, false, false, 5);
  44.                 // line 6
  45.                 echo "        ";
  46.                 twig_get_attribute($this->env, $this->source, $this->env->getFunction('pimcore_head_title')->getCallable()(), "setSeparator", [0 => " | "], "method", false, false, false, 6);
  47.                 // line 7
  48.                 echo "    ";
  49.             }
  50.             // line 8
  51.             echo "    ";
  52.             twig_get_attribute($this->env, $this->source, $this->env->getFunction('pimcore_head_meta')->getCallable()(), "setProperty", [0 => "og:title", 1 => twig_get_attribute($this->env, $this->source, $this->extensions['Twig\Extra\String\StringExtension']->createUnicodeString(twig_replace_filter(twig_striptags(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); })()), "title", [], "any", false, false, false, 8)), ["&shy;" => ""])), "truncate", [0 => 65, 1 => "...", 2 => false], "method", false, false, false, 8)], "method", false, false, false, 8);
  53.         } else {
  54.             // line 10
  55.             echo "    ";
  56.             twig_get_attribute($this->env, $this->source, $this->env->getFunction('pimcore_head_title')->getCallable()(), "set", [0 => (isset($context["pagename"]) || array_key_exists("pagename", $context) ? $context["pagename"] : (function () { throw new RuntimeError('Variable "pagename" does not exist.', 10, $this->source); })())], "method", false, false, false, 10);
  57.             // line 11
  58.             echo "    ";
  59.             twig_get_attribute($this->env, $this->source, $this->env->getFunction('pimcore_head_meta')->getCallable()(), "setProperty", [0 => "og:title", 1 => (isset($context["pagename"]) || array_key_exists("pagename", $context) ? $context["pagename"] : (function () { throw new RuntimeError('Variable "pagename" does not exist.', 11, $this->source); })())], "method", false, false, false, 11);
  60.         }
  61.         // line 13
  62.         echo "
  63. ";
  64.         // line 15
  65.         if (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.', 15, $this->source); })()), "description", [], "any", false, false, false, 15)) {
  66.             // line 16
  67.             echo "    ";
  68.             twig_get_attribute($this->env, $this->source, $this->env->getFunction('pimcore_head_meta')->getCallable()(), "setDescription", [0 => twig_get_attribute($this->env, $this->source, $this->extensions['Twig\Extra\String\StringExtension']->createUnicodeString(twig_striptags(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.', 16, $this->source); })()), "description", [], "any", false, false, false, 16))), "truncate", [0 => 150, 1 => "...", 2 => false], "method", false, false, false, 16)], "method", false, false, false, 16);
  69.             // line 17
  70.             echo "    ";
  71.             twig_get_attribute($this->env, $this->source, $this->env->getFunction('pimcore_head_meta')->getCallable()(), "setProperty", [0 => "og:description", 1 => twig_get_attribute($this->env, $this->source, $this->extensions['Twig\Extra\String\StringExtension']->createUnicodeString(twig_striptags(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.', 17, $this->source); })()), "description", [], "any", false, false, false, 17))), "truncate", [0 => 150, 1 => "...", 2 => false], "method", false, false, false, 17)], "method", false, false, false, 17);
  72.         }
  73.         // line 19
  74.         echo "
  75. ";
  76.         // line 21
  77.         if ((twig_get_attribute($this->env, $this->source, ($context["document"] ?? null), "getProperty", [0 => "ogImage"], "method", true, true, false, 21) && 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.', 21, $this->source); })()), "getProperty", [0 => "ogImage"], "method", false, false, false, 21))) {
  78.             // line 22
  79.             echo "    ";
  80.             twig_get_attribute($this->env, $this->source, $this->env->getFunction('pimcore_head_meta')->getCallable()(), "setProperty", [0 => "og:image", 1 => (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 22, $this->source); })()), "request", [], "any", false, false, false, 22), "getSchemeAndHttpHost", [], "method", false, false, false, 22) . twig_get_attribute($this->env, $this->source, 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.', 22, $this->source); })()), "getProperty", [0 => "ogImage"], "method", false, false, false, 22), "thumbnail", [0 => "linkedin"], "method", false, false, false, 22))], "method", false, false, false, 22);
  81.         } elseif ((        // line 23
  82. array_key_exists("ogImage", $context) && (isset($context["ogImage"]) || array_key_exists("ogImage", $context) ? $context["ogImage"] : (function () { throw new RuntimeError('Variable "ogImage" does not exist.', 23, $this->source); })()))) {
  83.             // line 24
  84.             echo "    ";
  85.             twig_get_attribute($this->env, $this->source, $this->env->getFunction('pimcore_head_meta')->getCallable()(), "setProperty", [0 => "og:image", 1 => (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 24, $this->source); })()), "request", [], "any", false, false, false, 24), "getSchemeAndHttpHost", [], "method", false, false, false, 24) . twig_get_attribute($this->env, $this->source, (isset($context["ogImage"]) || array_key_exists("ogImage", $context) ? $context["ogImage"] : (function () { throw new RuntimeError('Variable "ogImage" does not exist.', 24, $this->source); })()), "thumbnail", [0 => "linkedin"], "method", false, false, false, 24))], "method", false, false, false, 24);
  86.         }
  87.         // line 26
  88.         echo "
  89. ";
  90.         // line 28
  91.         twig_get_attribute($this->env, $this->source, $this->env->getFunction('pimcore_head_meta')->getCallable()(), "setProperty", [0 => "og:url", 1 => twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 28, $this->source); })()), "request", [], "any", false, false, false, 28), "uri", [], "any", false, false, false, 28)], "method", false, false, false, 28);
  92.         // line 29
  93.         twig_get_attribute($this->env, $this->source, $this->env->getFunction('pimcore_head_meta')->getCallable()(), "setProperty", [0 => "og:type", 1 => "website"], "method", false, false, false, 29);
  94.         // line 30
  95.         twig_get_attribute($this->env, $this->source, $this->env->getFunction('pimcore_head_meta')->getCallable()(), "setName", [0 => "robots", 1 => "index, follow"], "method", false, false, false, 30);
  96.         // line 31
  97.         twig_get_attribute($this->env, $this->source, $this->env->getFunction('pimcore_head_meta')->getCallable()(), "setName", [0 => "language", 1 => twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 31, $this->source); })()), "request", [], "any", false, false, false, 31), "locale", [], "any", false, false, false, 31)], "method", false, false, false, 31);
  98.         // line 32
  99.         echo "
  100. ";
  101.         // line 34
  102.         echo "<link rel=\"canonical\" href=\"";
  103.         echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 34, $this->source); })()), "request", [], "any", false, false, false, 34), "uri", [], "any", false, false, false, 34), "html", null, true);
  104.         echo "\">";
  105.         
  106.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  107.         
  108.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  109.     }
  110.     public function getTemplateName()
  111.     {
  112.         return "layout/head/meta/document.html.twig";
  113.     }
  114.     public function isTraitable()
  115.     {
  116.         return false;
  117.     }
  118.     public function getDebugInfo()
  119.     {
  120.         return array (  111 => 34,  108 => 32,  106 => 31,  104 => 30,  102 => 29,  100 => 28,  97 => 26,  93 => 24,  91 => 23,  88 => 22,  86 => 21,  83 => 19,  79 => 17,  76 => 16,  74 => 15,  71 => 13,  67 => 11,  64 => 10,  60 => 8,  57 => 7,  54 => 6,  51 => 5,  48 => 4,  45 => 3,  43 => 2,);
  121.     }
  122.     public function getSourceContext()
  123.     {
  124.         return new Source("{# title #}
  125. {% if document.title %}
  126.     {% do pimcore_head_title().set(document.title|striptags|replace({'&shy;': ''})|u.truncate(65, '...', false)) %}
  127.     {% if pagename != document.title %}
  128.         {% do pimcore_head_title().append(pagename) %}
  129.         {% do pimcore_head_title().setSeparator(' | ') %}
  130.     {% endif %}
  131.     {% do pimcore_head_meta().setProperty('og:title', document.title|striptags|replace({'&shy;': ''})|u.truncate(65, '...', false)) %}
  132. {% else %}
  133.     {% do pimcore_head_title().set(pagename) %}
  134.     {% do pimcore_head_meta().setProperty('og:title', pagename) %}
  135. {% endif %}
  136. {# description #}
  137. {% if document.description %}
  138.     {% do pimcore_head_meta().setDescription(document.description|striptags|u.truncate(150, '...', false)) %}
  139.     {% do pimcore_head_meta().setProperty('og:description', document.description|striptags|u.truncate(150, '...', false)) %}
  140. {% endif %}
  141. {# image #}
  142. {% if document.getProperty('ogImage') is defined and document.getProperty('ogImage') %}
  143.     {% do pimcore_head_meta().setProperty('og:image', app.request.getSchemeAndHttpHost() ~ document.getProperty('ogImage').thumbnail('linkedin')) %}
  144. {% elseif ogImage is defined and ogImage %}
  145.     {% do pimcore_head_meta().setProperty('og:image', app.request.getSchemeAndHttpHost() ~ ogImage.thumbnail('linkedin')) %}
  146. {% endif %}
  147. {# various #}
  148. {% do pimcore_head_meta().setProperty('og:url', app.request.uri) %}
  149. {% do pimcore_head_meta().setProperty('og:type', 'website') %}
  150. {% do pimcore_head_meta().setName('robots', 'index, follow') %}
  151. {% do pimcore_head_meta().setName('language', app.request.locale) %}
  152. {# canonical #}
  153. <link rel=\"canonical\" href=\"{{ app.request.uri }}\">", "layout/head/meta/document.html.twig", "/home/httpd/vhosts/a4interactive.ch/httpdocs/lutisbach.a4interactive.ch/templates/layout/head/meta/document.html.twig");
  154.     }
  155. }