<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
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\Sandbox\SecurityNotAllowedTestError;
use Twig\Source;
use Twig\Template;
use Twig\TemplateWrapper;
/* pages/_includes/base/sub_menu/_submenu.html.twig */
class __TwigTemplate_de93a18ba29ae9468199f95848c67d4c extends Template
{
private Source $source;
/**
* @var array<string, Template>
*/
private array $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 = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "pages/_includes/base/sub_menu/_submenu.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "pages/_includes/base/sub_menu/_submenu.html.twig"));
// line 2
$context["is_menu_mobile"] = (array_key_exists("mode", $context) && ((isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 2, $this->source); })()) == "mobile"));
// line 3
$context["submenu_templates"] = ["company" => "pages/_includes/base/sub_menu/_submenu_company.html.twig", "destination" => "pages/_includes/base/sub_menu/_submenu_destination.html.twig", "riverside" => "pages/_includes/base/sub_menu/_submenu_riverside.html.twig", "specialOffer" => "pages/_includes/base/sub_menu/_submenu_special_offers.html.twig", "groupsCe" => "pages/_includes/base/sub_menu/_submenu_groups_ce.html.twig"];
// line 10
yield "
<div class=\"site-header__mega br3 ";
// line 11
yield (string) (((($tmp = (isset($context["is_menu_mobile"]) || array_key_exists("is_menu_mobile", $context) ? $context["is_menu_mobile"] : (function () { throw new RuntimeError('Variable "is_menu_mobile" does not exist.', 11, $this->source); })())) && $tmp instanceof Markup ? (string) $tmp : $tmp)) ? ("accordion-content") : (""));
yield "\">
\t";
// line 12
if ( !(($tmp = (isset($context["is_menu_mobile"]) || array_key_exists("is_menu_mobile", $context) ? $context["is_menu_mobile"] : (function () { throw new RuntimeError('Variable "is_menu_mobile" does not exist.', 12, $this->source); })())) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 13
yield "\t\t<div class=\"site-header__mega-inner\">
\t";
}
// line 15
yield "
\t";
// line 16
if (CoreExtension::getAttribute($this->env, $this->source, ($context["submenu_templates"] ?? null), ((CoreExtension::getAttribute($this->env, $this->source, ($context["item"] ?? null), "typeItem", [], "any", true, true, false, 16)) ? (Twig\Extension\CoreExtension::default(CoreExtension::getAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 16, $this->source); })()), "typeItem", [], "any", false, false, false, 16), "")) : ("")), [], "array", true, true, false, 16)) {
// line 17
yield "\t\t";
yield from $this->load(CoreExtension::getAttribute($this->env, $this->source, (isset($context["submenu_templates"]) || array_key_exists("submenu_templates", $context) ? $context["submenu_templates"] : (function () { throw new RuntimeError('Variable "submenu_templates" does not exist.', 17, $this->source); })()), CoreExtension::getAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 17, $this->source); })()), "typeItem", [], "any", false, false, false, 17), [], "array", false, false, false, 17), 17)->unwrap()->yield(CoreExtension::toArray(["item" => // line 18
(isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 18, $this->source); })()), "mode" => (( // line 19
array_key_exists("mode", $context)) ? (Twig\Extension\CoreExtension::default((isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 19, $this->source); })()), "desktop")) : ("desktop"))]));
// line 21
yield "\t";
}
// line 22
yield "
\t";
// line 28
yield "
\t";
// line 29
if ((CoreExtension::getAttribute($this->env, $this->source, ($context["item"] ?? null), "isMedia", [], "any", true, true, false, 29) && (CoreExtension::getAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 29, $this->source); })()), "isMedia", [], "any", false, false, false, 29) == true))) {
// line 30
yield "\t\t";
$context["highlightedImage"] = (((CoreExtension::getAttribute($this->env, $this->source, ($context["item"] ?? null), "isExternalImage", [], "any", true, true, false, 30) && (CoreExtension::getAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 30, $this->source); })()), "isExternalImage", [], "any", false, false, false, 30) == true))) ? (CoreExtension::getAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 30, $this->source); })()), "externalImage", [], "any", false, false, false, 30)) : (((CoreExtension::getAttribute($this->env, $this->source, ($context["item"] ?? null), "internalImage", [], "any", true, true, false, 30)) ? ($this->extensions['App\Twig\MediaExtension']->getMediaUrlWithFallback(CoreExtension::getAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 30, $this->source); })()), "internalImage", [], "any", false, false, false, 30), "800x")) : ($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("img/placeholders/menu.jpg")))));
// line 31
yield "\t\t<div class=\"highlighted-image\">
\t\t\t";
// line 32
if ((CoreExtension::getAttribute($this->env, $this->source, ($context["item"] ?? null), "isLink", [], "any", true, true, false, 32) && (CoreExtension::getAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 32, $this->source); })()), "isLink", [], "any", false, false, false, 32) == true))) {
// line 33
yield "\t\t\t\t";
if ((CoreExtension::getAttribute($this->env, $this->source, ($context["item"] ?? null), "isExternalLink", [], "any", true, true, false, 33) && (CoreExtension::getAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 33, $this->source); })()), "isExternalLink", [], "any", false, false, false, 33) == true))) {
// line 34
yield "\t\t\t\t\t<a href=\"";
yield (string) $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((CoreExtension::getAttribute($this->env, $this->source, ($context["item"] ?? null), "externalLink", [], "any", true, true, false, 34)) ? (Twig\Extension\CoreExtension::default(CoreExtension::getAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 34, $this->source); })()), "externalLink", [], "any", false, false, false, 34), "")) : ("")), "html", null, true);
yield "\" target=\"_blank\" rel=\"nofollow\">
\t\t\t\t\t\t<img class=\"br2\" src=\"";
// line 35
yield (string) $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["highlightedImage"]) || array_key_exists("highlightedImage", $context) ? $context["highlightedImage"] : (function () { throw new RuntimeError('Variable "highlightedImage" does not exist.', 35, $this->source); })()), "html", null, true);
yield "\" alt=\"\">
\t\t\t\t\t</a>
\t\t\t\t";
} else {
// line 38
yield "\t\t\t\t\t<sulu-link href=\"";
yield (string) $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((CoreExtension::getAttribute($this->env, $this->source, ($context["item"] ?? null), "internalLink", [], "any", true, true, false, 38)) ? (Twig\Extension\CoreExtension::default(CoreExtension::getAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 38, $this->source); })()), "internalLink", [], "any", false, false, false, 38), "")) : ("")), "html", null, true);
yield "\">
\t\t\t\t\t\t<img class=\"br2\" src=\"";
// line 39
yield (string) $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["highlightedImage"]) || array_key_exists("highlightedImage", $context) ? $context["highlightedImage"] : (function () { throw new RuntimeError('Variable "highlightedImage" does not exist.', 39, $this->source); })()), "html", null, true);
yield "\" alt=\"\">
\t\t\t\t\t</sulu-link>
\t\t\t\t";
}
// line 42
yield "\t\t\t";
} else {
// line 43
yield "\t\t\t\t<img class=\"br2\" src=\"";
yield (string) $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["highlightedImage"]) || array_key_exists("highlightedImage", $context) ? $context["highlightedImage"] : (function () { throw new RuntimeError('Variable "highlightedImage" does not exist.', 43, $this->source); })()), "html", null, true);
yield "\" alt=\"\">
\t\t\t";
}
// line 45
yield "\t\t</div>
\t";
}
// line 47
yield "
\t";
// line 48
if ( !(($tmp = (isset($context["is_menu_mobile"]) || array_key_exists("is_menu_mobile", $context) ? $context["is_menu_mobile"] : (function () { throw new RuntimeError('Variable "is_menu_mobile" does not exist.', 48, $this->source); })())) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 49
yield "\t\t</div>
\t";
}
// line 51
yield "</div>
";
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
yield from [];
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "pages/_includes/base/sub_menu/_submenu.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable(): bool
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
return array ( 142 => 51, 138 => 49, 136 => 48, 133 => 47, 129 => 45, 123 => 43, 120 => 42, 114 => 39, 109 => 38, 103 => 35, 98 => 34, 95 => 33, 93 => 32, 90 => 31, 87 => 30, 85 => 29, 82 => 28, 79 => 22, 76 => 21, 74 => 19, 73 => 18, 71 => 17, 69 => 16, 66 => 15, 62 => 13, 60 => 12, 56 => 11, 53 => 10, 51 => 3, 49 => 2,);
}
public function getSourceContext(): Source
{
return new Source("{# navigationItem : bloc Sulu (typeItem, singleLabel, multipleLabel) #}
{% set is_menu_mobile = mode is defined and mode == \x27mobile\x27 %}
{% set submenu_templates = {
\t\x27company\x27: \x27pages/_includes/base/sub_menu/_submenu_company.html.twig\x27,
\t\x27destination\x27: \x27pages/_includes/base/sub_menu/_submenu_destination.html.twig\x27,
\t\x27riverside\x27: \x27pages/_includes/base/sub_menu/_submenu_riverside.html.twig\x27,
\t\x27specialOffer\x27: \x27pages/_includes/base/sub_menu/_submenu_special_offers.html.twig\x27,
\t\x27groupsCe\x27: \x27pages/_includes/base/sub_menu/_submenu_groups_ce.html.twig\x27,
} %}
<div class=\"site-header__mega br3 {{ is_menu_mobile ? \x27accordion-content\x27 : \x27\x27 }}\">
\t{% if not is_menu_mobile %}
\t\t<div class=\"site-header__mega-inner\">
\t{% endif %}
\t{% if submenu_templates[item.typeItem|default(\x27\x27)] is defined %}
\t\t{% include submenu_templates[item.typeItem] with {
\t\t\titem: item,
\t\t\tmode: mode|default(\x27desktop\x27),
\t\t} only %}
\t{% endif %}
\t{#
\t\tGérer l\x27image mise en avant dans chaque sous-menu
\t\tOn regarde si un média est lié, si oui s\x27il est externe ou interne, et on affiche l\x27image correspondante.
\t\tSi un lien est lié à l\x27image, on regarde s\x27il est externe ou interne, et on ajoute des balises <a> ou <sulu-link> selon le cas. Sinon, on renvoie juste l\x27image.
\t#}
\t{% if item.isMedia is defined and item.isMedia == true %}
\t\t{% set highlightedImage = item.isExternalImage is defined and item.isExternalImage == true ? item.externalImage : item.internalImage is defined ? sulu_media_url(item.internalImage, \x27800x\x27) : asset(\x27img/placeholders/menu.jpg\x27) %}
\t\t<div class=\"highlighted-image\">
\t\t\t{% if item.isLink is defined and item.isLink == true %}
\t\t\t\t{% if item.isExternalLink is defined and item.isExternalLink == true %}
\t\t\t\t\t<a href=\"{{ item.externalLink|default(\x27\x27) }}\" target=\"_blank\" rel=\"nofollow\">
\t\t\t\t\t\t<img class=\"br2\" src=\"{{ highlightedImage }}\" alt=\"\">
\t\t\t\t\t</a>
\t\t\t\t{% else %}
\t\t\t\t\t<sulu-link href=\"{{ item.internalLink|default(\x27\x27) }}\">
\t\t\t\t\t\t<img class=\"br2\" src=\"{{ highlightedImage }}\" alt=\"\">
\t\t\t\t\t</sulu-link>
\t\t\t\t{% endif %}
\t\t\t{% else %}
\t\t\t\t<img class=\"br2\" src=\"{{ highlightedImage }}\" alt=\"\">
\t\t\t{% endif %}
\t\t</div>
\t{% endif %}
\t{% if not is_menu_mobile %}
\t\t</div>
\t{% endif %}
</div>
", "pages/_includes/base/sub_menu/_submenu.html.twig", "/home/croisiland-pp/www/f0312421abff37637dabe6f4d57b6afd95d16263/templates/pages/_includes/base/sub_menu/_submenu.html.twig");
}
}