var/cache/dev/twig/c3/c3e092c7d6dab7538b3f947b5f7f7bfce2affe1b0973e33d96e16b597baf79e2.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_32a7355343e36db0a5a3ade1f5e34de15db8c4313a834f65055f8dd75a343d8f 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->sourcecall_user_func_array($this->env->getFunction('pimcore_head_title')->getCallable(), []), "set", [=> 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"falsefalsefalse7)], "method"falsefalsefalse7);
  48.             // line 8
  49.             echo "    ";
  50.             twig_get_attribute($this->env$this->sourcecall_user_func_array($this->env->getFunction('pimcore_head_meta')->getCallable(), []), "appendName", [=> "description"=> 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"falsefalsefalse8)], "method"falsefalsefalse8);
  51.             // line 9
  52.             echo "    
  53.     ";
  54.             // line 10
  55.             twig_get_attribute($this->env$this->sourcecall_user_func_array($this->env->getFunction('pimcore_head_meta')->getCallable(), []), "setProperty", [=> "og:type"=> "website"], "method"falsefalsefalse10);
  56.             // line 11
  57.             echo "    ";
  58.             twig_get_attribute($this->env$this->sourcecall_user_func_array($this->env->getFunction('pimcore_head_meta')->getCallable(), []), "setProperty", [=> "og:url"=> twig_get_attribute($this->env$this->sourcetwig_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"falsefalsefalse11), "getSchemeAndHttpHost", [=> 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"falsefalsefalse11)], "method"falsefalsefalse11)], "method"falsefalsefalse11);
  59.             // line 12
  60.             echo "    ";
  61.             twig_get_attribute($this->env$this->sourcecall_user_func_array($this->env->getFunction('pimcore_head_meta')->getCallable(), []), "setProperty", [=> "og:title"=> 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"falsefalsefalse12)], "method"falsefalsefalse12);
  62.             // line 13
  63.             echo "    ";
  64.             twig_get_attribute($this->env$this->sourcecall_user_func_array($this->env->getFunction('pimcore_head_meta')->getCallable(), []), "setProperty", [=> "og:description"=> 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"falsefalsefalse13)], "method"falsefalsefalse13);
  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", [=> "seoImage"], "method"falsefalsefalse14)) {
  68.                 // line 15
  69.                 echo "        ";
  70.                 twig_get_attribute($this->env$this->sourcecall_user_func_array($this->env->getFunction('pimcore_head_meta')->getCallable(), []), "setProperty", [=> "og:image"=> (twig_get_attribute($this->env$this->sourcetwig_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"falsefalsefalse15), "getSchemeAndHttpHost", [], "method"falsefalsefalse15) . 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", [=> "seoImage"], "method"falsefalsefalse15))], "method"falsefalsefalse15);
  71.                 echo "    
  72.     ";
  73.             } else {
  74.                 // line 17
  75.                 echo "        ";
  76.                 twig_get_attribute($this->env$this->sourcecall_user_func_array($this->env->getFunction('pimcore_head_meta')->getCallable(), []), "setProperty", [=> "og:image"=> twig_get_attribute($this->env$this->sourcetwig_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"falsefalsefalse17), "getSchemeAndHttpHost", [], "method"falsefalsefalse17)], "method"falsefalsefalse17);
  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"falsefalsefalse30), ((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"falsefalsefalse31)) ? (twig_slice($this->envstrip_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"falsefalsefalse31)), 0200)) : ((((twig_length_filter($this->envtwig_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"falsefalsefalse31)) > 200)) ? ((twig_slice($this->envstrip_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"falsefalsefalse31)), 0200) . "...")) : (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"falsefalsefalse31)))))), ((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", [=> "seoImage"], "method"falsefalsefalse32)) ? (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", [=> "seoImage"], "method"falsefalsefalse32)) : (null)), nullnullnull), "html"nulltrue);
  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"falsefalsefalse43), 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"falsefalsefalse44), nullnullnull), "html"nulltrue);
  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->sourcetwig_get_attribute($this->env$this->sourcecall_user_func_array($this->env->getFunction('pimcore_head_meta')->getCallable(), []), "appendHttpEquiv", [=> "Content-Type"=> "text/html; charset=UTF-8"], "method"falsefalsefalse54), "appendHttpEquiv", [=> "Content-Language"=> twig_get_attribute($this->env$this->sourcetwig_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"falsefalsefalse54), "locale", [], "any"falsefalsefalse54)], "method"falsefalsefalse54);
  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->sourcecall_user_func_array($this->env->getFunction('pimcore_head_title')->getCallable(), []), "setSeparator", [=> " / "], "method"falsefalsefalse59);
  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. }