<?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;
/* head/metas.html.twig */
class __TwigTemplate_32a7355343e36db0a5a3ade1f5e34de15db8c4313a834f65055f8dd75a343d8f 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_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "head/metas.html.twig"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "head/metas.html.twig"));
// line 1
echo "
";
// line 3
$context["metaOg"] = "";
// line 4
echo "
";
// line 5
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"])) {
// line 6
echo " ";
// line 7
echo " ";
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);
// line 8
echo " ";
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);
// line 9
echo "
";
// line 10
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);
// line 11
echo " ";
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);
// line 12
echo " ";
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);
// line 13
echo " ";
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);
// line 14
echo " ";
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)) {
// line 15
echo " ";
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);
echo "
";
} else {
// line 17
echo " ";
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);
echo "
";
}
// line 19
echo "
";
}
// line 21
echo "
";
// line 22
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"])) {
// line 23
echo " ";
// line 24
echo "
";
// line 25
if (array_key_exists("seoNews", $context)) {
// line 26
echo "
";
// line 27
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
(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
(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
(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);
// line 36
echo "
";
} elseif ( // line 38
array_key_exists("seoBusiness", $context)) {
// line 39
echo "
";
// line 40
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
(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
(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);
// line 48
echo "
";
}
// line 51
echo "
";
}
// line 53
echo "
";
// line 54
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);
// line 55
echo "
";
// line 57
$context["websiteName"] = $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Your website name");
// line 58
echo "
";
// line 59
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);
// line 60
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); })())]);
// line 61
echo "
";
// line 62
echo call_user_func_array($this->env->getFunction('pimcore_head_title')->getCallable(), []);
echo "
";
// line 63
echo call_user_func_array($this->env->getFunction('pimcore_head_meta')->getCallable(), []);
echo "
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">
";
// line 67
echo $this->extensions['App\Twig\Extension\Apik']->getRobotsIndex();
echo "
";
// line 68
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); })()));
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
}
public function getTemplateName()
{
return "head/metas.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
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,);
}
public function getSourceContext()
{
return new Source("
{% set metaOg = \"\" %}
{% if document is instanceof('\\\\Pimcore\\\\Model\\\\Document\\\\page') %}
{# Titre et metadescription #}
{% do pimcore_head_title().set(document.getTitle()) %}
{% do pimcore_head_meta().appendName('description', document.getDescription()) %}
{% do pimcore_head_meta().setProperty('og:type', 'website') %}
{% do pimcore_head_meta().setProperty('og:url', app.request.getSchemeAndHttpHost(document.fullpath)) %}
{% do pimcore_head_meta().setProperty('og:title', document.getTitle()) %}
{% do pimcore_head_meta().setProperty('og:description', document.getDescription()) %}
{% if document.property('seoImage') %}
{% do pimcore_head_meta().setProperty('og:image', app.request.getSchemeAndHttpHost() ~ document.property('seoImage')) %}
{% else %}
{% do pimcore_head_meta().setProperty('og:image', app.request.getSchemeAndHttpHost()) %}
{% endif %}
{% endif %}
{% if document is instanceof('\\\\Pimcore\\\\Model\\\\Document') %}
{# ...à partir des champs personnalisés d'un Data Object #}
{% if seoNews is defined %}
{{ set_seo(
pimcore_head_title(),
pimcore_head_meta(),
news.title,
news.shortText ? news.shortText|striptags|slice(0, 200)|raw : news.shortText|length > 200 ? news.shortText|striptags|slice(0, 200)|raw ~ '...' : news.shortText|striptags|raw,
document.property('seoImage') ? document.property('seoImage') : null,
null,
null,
null
) }}
{% elseif seoBusiness is defined %}
{{ set_seo(
pimcore_head_title(),
pimcore_head_meta(),
business.name,
business.presentation,
null,
null,
null
) }}
{% endif %}
{% endif %}
{% do pimcore_head_meta().appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8').appendHttpEquiv('Content-Language', app.request.locale) %}
{% set websiteName = \"Your website name\"|trans %}
{% do pimcore_head_title().setSeparator(' / ') %}
{% do pimcore_head_title(websiteName) %}
{{ pimcore_head_title() }}
{{ pimcore_head_meta() }}
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">
{{ get_robots_index()|raw }}
{{ get_links_alternate(document)|raw }}", "head/metas.html.twig", "/var/www/mynursery.apik-pp.be/www/templates/head/metas.html.twig");
}
}