var/cache/dev/twig/e1/e1a459c6eca68e45fdc55734926c43bd7cd465e9a68e610762615bcda314c314.php line 173

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. /* head/metas.html.twig */
  14. class __TwigTemplate_3a4795eb5a243aacd76713d8c4f7bab26c081934b87ad7f6fdea242d9921b6bc 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_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  30.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "head/metas.html.twig"));
  31.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  32.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "head/metas.html.twig"));
  33.         // line 1
  34.         echo "
  35. ";
  36.         // line 3
  37.         $context["metaOg"] = "";
  38.         // line 4
  39.         echo "
  40. ";
  41.         // line 5
  42.         if (call_user_func_array($this->env->getTest('instanceof')->getCallable(), [(isset($context["document"]) || array_key_exists("document", $context) ? $context["document"] : (function () { throw new RuntimeError('Variable "document" does not exist.', 5, $this->source); })()), "\\Pimcore\\Model\\Document\\page"])) {
  43.             // line 6
  44.             echo "    ";
  45.             // line 7
  46.             echo "    ";
  47.             twig_get_attribute($this->env, $this->source, call_user_func_array($this->env->getFunction('pimcore_head_title')->getCallable(), []), "set", [0 => 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); })()), "getTitle", [], "method", false, false, false, 7)], "method", false, false, false, 7);
  48.             // line 8
  49.             echo "    ";
  50.             twig_get_attribute($this->env, $this->source, call_user_func_array($this->env->getFunction('pimcore_head_meta')->getCallable(), []), "appendName", [0 => "description", 1 => 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); })()), "getDescription", [], "method", false, false, false, 8)], "method", false, false, false, 8);
  51.             // line 9
  52.             echo "    
  53.     ";
  54.             // line 10
  55.             twig_get_attribute($this->env, $this->source, call_user_func_array($this->env->getFunction('pimcore_head_meta')->getCallable(), []), "setProperty", [0 => "og:type", 1 => "website"], "method", false, false, false, 10);
  56.             // line 11
  57.             echo "    ";
  58.             twig_get_attribute($this->env, $this->source, call_user_func_array($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.', 11, $this->source); })()), "request", [], "any", false, false, false, 11), "getSchemeAndHttpHost", [0 => 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.', 11, $this->source); })()), "fullpath", [], "any", false, false, false, 11)], "method", false, false, false, 11)], "method", false, false, false, 11);
  59.             // line 12
  60.             echo "    ";
  61.             twig_get_attribute($this->env, $this->source, call_user_func_array($this->env->getFunction('pimcore_head_meta')->getCallable(), []), "setProperty", [0 => "og:title", 1 => 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.', 12, $this->source); })()), "getTitle", [], "method", false, false, false, 12)], "method", false, false, false, 12);
  62.             // line 13
  63.             echo "    ";
  64.             twig_get_attribute($this->env, $this->source, call_user_func_array($this->env->getFunction('pimcore_head_meta')->getCallable(), []), "setProperty", [0 => "og:description", 1 => 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.', 13, $this->source); })()), "getDescription", [], "method", false, false, false, 13)], "method", false, false, false, 13);
  65.             // line 14
  66.             echo "    ";
  67.             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.', 14, $this->source); })()), "property", [0 => "seoImage"], "method", false, false, false, 14)) {
  68.                 // line 15
  69.                 echo "        ";
  70.                 twig_get_attribute($this->env, $this->source, call_user_func_array($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.', 15, $this->source); })()), "request", [], "any", false, false, false, 15), "getSchemeAndHttpHost", [], "method", false, false, false, 15) . 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); })()), "property", [0 => "seoImage"], "method", false, false, false, 15))], "method", false, false, false, 15);
  71.                 echo "    
  72.     ";
  73.             } else {
  74.                 // line 17
  75.                 echo "        ";
  76.                 twig_get_attribute($this->env, $this->source, call_user_func_array($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.', 17, $this->source); })()), "request", [], "any", false, false, false, 17), "getSchemeAndHttpHost", [], "method", false, false, false, 17)], "method", false, false, false, 17);
  77.                 echo "    
  78.     ";
  79.             }
  80.             // line 19
  81.             echo "    
  82. ";
  83.         }
  84.         // line 21
  85.         echo "
  86. ";
  87.         // line 22
  88.         if (call_user_func_array($this->env->getTest('instanceof')->getCallable(), [(isset($context["document"]) || array_key_exists("document", $context) ? $context["document"] : (function () { throw new RuntimeError('Variable "document" does not exist.', 22, $this->source); })()), "\\Pimcore\\Model\\Document"])) {
  89.             // line 23
  90.             echo "    ";
  91.             // line 24
  92.             echo "
  93.     ";
  94.             // line 25
  95.             if (array_key_exists("seoNews", $context)) {
  96.                 // line 26
  97.                 echo "
  98.         ";
  99.                 // line 27
  100.                 echo twig_escape_filter($this->env, $this->extensions['App\Twig\Extension\Apik']->setSeo(call_user_func_array($this->env->getFunction('pimcore_head_title')->getCallable(), []), call_user_func_array($this->env->getFunction('pimcore_head_meta')->getCallable(), []), twig_get_attribute($this->env, $this->source,                 // line 30
  101. (isset($context["news"]) || array_key_exists("news", $context) ? $context["news"] : (function () { throw new RuntimeError('Variable "news" does not exist.', 30, $this->source); })()), "title", [], "any", false, false, false, 30), ((twig_get_attribute($this->env, $this->source,                 // line 31
  102. (isset($context["news"]) || array_key_exists("news", $context) ? $context["news"] : (function () { throw new RuntimeError('Variable "news" does not exist.', 31, $this->source); })()), "shortText", [], "any", false, false, false, 31)) ? (twig_slice($this->env, strip_tags(twig_get_attribute($this->env, $this->source, (isset($context["news"]) || array_key_exists("news", $context) ? $context["news"] : (function () { throw new RuntimeError('Variable "news" does not exist.', 31, $this->source); })()), "shortText", [], "any", false, false, false, 31)), 0, 200)) : ((((twig_length_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["news"]) || array_key_exists("news", $context) ? $context["news"] : (function () { throw new RuntimeError('Variable "news" does not exist.', 31, $this->source); })()), "shortText", [], "any", false, false, false, 31)) > 200)) ? ((twig_slice($this->env, strip_tags(twig_get_attribute($this->env, $this->source, (isset($context["news"]) || array_key_exists("news", $context) ? $context["news"] : (function () { throw new RuntimeError('Variable "news" does not exist.', 31, $this->source); })()), "shortText", [], "any", false, false, false, 31)), 0, 200) . "...")) : (strip_tags(twig_get_attribute($this->env, $this->source, (isset($context["news"]) || array_key_exists("news", $context) ? $context["news"] : (function () { throw new RuntimeError('Variable "news" does not exist.', 31, $this->source); })()), "shortText", [], "any", false, false, false, 31)))))), ((twig_get_attribute($this->env, $this->source,                 // line 32
  103. (isset($context["document"]) || array_key_exists("document", $context) ? $context["document"] : (function () { throw new RuntimeError('Variable "document" does not exist.', 32, $this->source); })()), "property", [0 => "seoImage"], "method", false, false, false, 32)) ? (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.', 32, $this->source); })()), "property", [0 => "seoImage"], "method", false, false, false, 32)) : (null)), null, null, null), "html", null, true);
  104.                 // line 36
  105.                 echo "
  106.     ";
  107.             } elseif (            // line 38
  108. array_key_exists("seoBusiness", $context)) {
  109.                 // line 39
  110.                 echo "
  111.         ";
  112.                 // line 40
  113.                 echo twig_escape_filter($this->env, $this->extensions['App\Twig\Extension\Apik']->setSeo(call_user_func_array($this->env->getFunction('pimcore_head_title')->getCallable(), []), call_user_func_array($this->env->getFunction('pimcore_head_meta')->getCallable(), []), twig_get_attribute($this->env, $this->source,                 // line 43
  114. (isset($context["business"]) || array_key_exists("business", $context) ? $context["business"] : (function () { throw new RuntimeError('Variable "business" does not exist.', 43, $this->source); })()), "name", [], "any", false, false, false, 43), twig_get_attribute($this->env, $this->source,                 // line 44
  115. (isset($context["business"]) || array_key_exists("business", $context) ? $context["business"] : (function () { throw new RuntimeError('Variable "business" does not exist.', 44, $this->source); })()), "presentation", [], "any", false, false, false, 44), null, null, null), "html", null, true);
  116.                 // line 48
  117.                 echo "
  118.             
  119.     ";
  120.             }
  121.             // line 51
  122.             echo "
  123. ";
  124.         }
  125.         // line 53
  126.         echo "
  127. ";
  128.         // line 54
  129.         twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, call_user_func_array($this->env->getFunction('pimcore_head_meta')->getCallable(), []), "appendHttpEquiv", [0 => "Content-Type", 1 => "text/html; charset=UTF-8"], "method", false, false, false, 54), "appendHttpEquiv", [0 => "Content-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.', 54, $this->source); })()), "request", [], "any", false, false, false, 54), "locale", [], "any", false, false, false, 54)], "method", false, false, false, 54);
  130.         // line 55
  131.         echo "
  132. ";
  133.         // line 57
  134.         $context["websiteName"] = $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Your website name");
  135.         // line 58
  136.         echo "
  137. ";
  138.         // line 59
  139.         twig_get_attribute($this->env, $this->source, call_user_func_array($this->env->getFunction('pimcore_head_title')->getCallable(), []), "setSeparator", [0 => " / "], "method", false, false, false, 59);
  140.         // line 60
  141.         call_user_func_array($this->env->getFunction('pimcore_head_title')->getCallable(), [(isset($context["websiteName"]) || array_key_exists("websiteName", $context) ? $context["websiteName"] : (function () { throw new RuntimeError('Variable "websiteName" does not exist.', 60, $this->source); })())]);
  142.         // line 61
  143.         echo "
  144. ";
  145.         // line 62
  146.         echo call_user_func_array($this->env->getFunction('pimcore_head_title')->getCallable(), []);
  147.         echo "
  148. ";
  149.         // line 63
  150.         echo call_user_func_array($this->env->getFunction('pimcore_head_meta')->getCallable(), []);
  151.         echo "
  152. <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">
  153. ";
  154.         // line 67
  155.         echo $this->extensions['App\Twig\Extension\Apik']->getRobotsIndex();
  156.         echo "
  157. ";
  158.         // line 68
  159.         echo $this->extensions['App\Twig\Extension\Apik']->getLinksAlternate((isset($context["document"]) || array_key_exists("document", $context) ? $context["document"] : (function () { throw new RuntimeError('Variable "document" does not exist.', 68, $this->source); })()));
  160.         
  161.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  162.         
  163.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  164.     }
  165.     public function getTemplateName()
  166.     {
  167.         return "head/metas.html.twig";
  168.     }
  169.     public function isTraitable()
  170.     {
  171.         return false;
  172.     }
  173.     public function getDebugInfo()
  174.     {
  175.         return array (  173 => 68,  169 => 67,  162 => 63,  158 => 62,  155 => 61,  153 => 60,  151 => 59,  148 => 58,  146 => 57,  142 => 55,  140 => 54,  137 => 53,  133 => 51,  128 => 48,  126 => 44,  125 => 43,  124 => 40,  121 => 39,  119 => 38,  115 => 36,  113 => 32,  112 => 31,  111 => 30,  110 => 27,  107 => 26,  105 => 25,  102 => 24,  100 => 23,  98 => 22,  95 => 21,  91 => 19,  85 => 17,  79 => 15,  76 => 14,  73 => 13,  70 => 12,  67 => 11,  65 => 10,  62 => 9,  59 => 8,  56 => 7,  54 => 6,  52 => 5,  49 => 4,  47 => 3,  43 => 1,);
  176.     }
  177.     public function getSourceContext()
  178.     {
  179.         return new Source("
  180. {% set metaOg = \"\" %}
  181. {% if document is instanceof('\\\\Pimcore\\\\Model\\\\Document\\\\page')  %}
  182.     {# Titre et metadescription #}
  183.     {% do pimcore_head_title().set(document.getTitle()) %}
  184.     {% do pimcore_head_meta().appendName('description', document.getDescription()) %}
  185.     
  186.     {% do pimcore_head_meta().setProperty('og:type', 'website') %}
  187.     {% do pimcore_head_meta().setProperty('og:url', app.request.getSchemeAndHttpHost(document.fullpath)) %}
  188.     {% do pimcore_head_meta().setProperty('og:title', document.getTitle()) %}
  189.     {% do pimcore_head_meta().setProperty('og:description', document.getDescription()) %}
  190.     {% if document.property('seoImage') %}
  191.         {% do pimcore_head_meta().setProperty('og:image', app.request.getSchemeAndHttpHost() ~ document.property('seoImage')) %}    
  192.     {% else %}
  193.         {% do pimcore_head_meta().setProperty('og:image', app.request.getSchemeAndHttpHost()) %}    
  194.     {% endif %}
  195.     
  196. {% endif %}
  197. {% if document is instanceof('\\\\Pimcore\\\\Model\\\\Document')  %}
  198.     {# ...à partir des champs personnalisés d'un Data Object #}
  199.     {% if seoNews is defined %}
  200.         {{ set_seo(
  201.             pimcore_head_title(),
  202.             pimcore_head_meta(),
  203.             news.title,
  204.             news.shortText ? news.shortText|striptags|slice(0, 200)|raw : news.shortText|length > 200 ? news.shortText|striptags|slice(0, 200)|raw ~ '...' : news.shortText|striptags|raw,
  205.             document.property('seoImage') ? document.property('seoImage') : null,
  206.             null,
  207.             null,
  208.             null
  209.         ) }}
  210.     {% elseif seoBusiness is defined %}
  211.         {{ set_seo(
  212.             pimcore_head_title(),
  213.             pimcore_head_meta(),
  214.             business.name,
  215.             business.presentation,
  216.             null,
  217.             null,
  218.             null
  219.         ) }}
  220.             
  221.     {% endif %}
  222. {% endif %}
  223. {% do pimcore_head_meta().appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8').appendHttpEquiv('Content-Language', app.request.locale) %}
  224. {% set websiteName = \"Your website name\"|trans %}
  225. {% do pimcore_head_title().setSeparator(' / ') %}
  226. {% do pimcore_head_title(websiteName) %}
  227. {{ pimcore_head_title() }}
  228. {{ pimcore_head_meta() }}
  229. <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">
  230. {{ get_robots_index()|raw }}
  231. {{ get_links_alternate(document)|raw }}", "head/metas.html.twig", "/var/www/mynursery.apik-pp.be/www/templates/head/metas.html.twig");
  232.     }
  233. }