<?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\Source;
use Twig\Template;
/* api/blocks/api_search_render.html.twig */
class __TwigTemplate_a2150617cd2334d534e83bcb1891addf015976e5e3c8da6965a599c017e46471 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", "api/blocks/api_search_render.html.twig"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "api/blocks/api_search_render.html.twig"));
// line 1
$context["article"] = $this->env->getFunction('sulu_content_load')->getCallable()((isset($context["id"]) || array_key_exists("id", $context) ? $context["id"] : (function () { throw new RuntimeError('Variable "id" does not exist.', 1, $this->source); })()));
// line 2
if ((((CoreExtension::getAttribute($this->env, $this->source, ($context["article"] ?? null), "author", [], "any", true, true, false, 2) && !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 2, $this->source); })()), "author", [], "any", false, false, false, 2))) && CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, // line 3
($context["article"] ?? null), "author", [], "any", false, true, false, 3), "contact", [], "any", true, true, false, 3)) && !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 3, $this->source); })()), "author", [], "any", false, false, false, 3), "contact", [], "any", false, false, false, 3)))) {
// line 4
yield "\t";
$context["author"] = CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $this->extensions['Sulu\Bundle\SecurityBundle\Twig\UserTwigExtension']->resolveUserFunction(CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 4, $this->source); })()), "author", [], "any", false, false, false, 4)), "contact", [], "any", false, false, false, 4), "fullName", [], "any", false, false, false, 4);
}
// line 6
if ((CoreExtension::getAttribute($this->env, $this->source, ($context["article"] ?? null), "content", [], "any", true, true, false, 6) && !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 6, $this->source); })()), "content", [], "any", false, false, false, 6)))) {
// line 7
yield "\t";
$context["articleContent"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 7, $this->source); })()), "content", [], "any", false, false, false, 7);
}
// line 9
if ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["article"] ?? null), "extension", [], "any", false, true, false, 9), "excerpt", [], "any", false, true, false, 9), "categories", [], "any", true, true, false, 9) && !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 9, $this->source); })()), "extension", [], "any", false, false, false, 9), "excerpt", [], "any", false, false, false, 9), "categories", [], "any", false, false, false, 9)))) {
// line 10
yield "\t";
$context["categories"] = CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 10, $this->source); })()), "extension", [], "any", false, false, false, 10), "excerpt", [], "any", false, false, false, 10), "categories", [], "any", false, false, false, 10);
}
// line 12
if ((CoreExtension::getAttribute($this->env, $this->source, ($context["articleContent"] ?? null), "chapo", [], "any", true, true, false, 12) && !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, (isset($context["articleContent"]) || array_key_exists("articleContent", $context) ? $context["articleContent"] : (function () { throw new RuntimeError('Variable "articleContent" does not exist.', 12, $this->source); })()), "chapo", [], "any", false, false, false, 12)))) {
// line 13
yield "\t";
$context["chapo"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["articleContent"]) || array_key_exists("articleContent", $context) ? $context["articleContent"] : (function () { throw new RuntimeError('Variable "articleContent" does not exist.', 13, $this->source); })()), "chapo", [], "any", false, false, false, 13);
}
// line 15
if ((CoreExtension::getAttribute($this->env, $this->source, ($context["articleContent"] ?? null), "routePath", [], "any", true, true, false, 15) && !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, (isset($context["articleContent"]) || array_key_exists("articleContent", $context) ? $context["articleContent"] : (function () { throw new RuntimeError('Variable "articleContent" does not exist.', 15, $this->source); })()), "routePath", [], "any", false, false, false, 15)))) {
// line 16
yield "\t";
$context["routePath"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["articleContent"]) || array_key_exists("articleContent", $context) ? $context["articleContent"] : (function () { throw new RuntimeError('Variable "articleContent" does not exist.', 16, $this->source); })()), "routePath", [], "any", false, false, false, 16);
}
// line 18
if ((CoreExtension::getAttribute($this->env, $this->source, ($context["articleContent"] ?? null), "title", [], "any", true, true, false, 18) && !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, (isset($context["articleContent"]) || array_key_exists("articleContent", $context) ? $context["articleContent"] : (function () { throw new RuntimeError('Variable "articleContent" does not exist.', 18, $this->source); })()), "title", [], "any", false, false, false, 18)))) {
// line 19
yield "\t";
$context["title"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["articleContent"]) || array_key_exists("articleContent", $context) ? $context["articleContent"] : (function () { throw new RuntimeError('Variable "articleContent" does not exist.', 19, $this->source); })()), "title", [], "any", false, false, false, 19);
}
// line 21
if ((CoreExtension::getAttribute($this->env, $this->source, ($context["articleContent"] ?? null), "front_title", [], "any", true, true, false, 21) && !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, (isset($context["articleContent"]) || array_key_exists("articleContent", $context) ? $context["articleContent"] : (function () { throw new RuntimeError('Variable "articleContent" does not exist.', 21, $this->source); })()), "front_title", [], "any", false, false, false, 21)))) {
// line 22
yield "\t";
$context["title"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["articleContent"]) || array_key_exists("articleContent", $context) ? $context["articleContent"] : (function () { throw new RuntimeError('Variable "articleContent" does not exist.', 22, $this->source); })()), "front_title", [], "any", false, false, false, 22);
}
// line 24
yield "
";
// line 25
if ((CoreExtension::getAttribute($this->env, $this->source, ($context["article"] ?? null), "template", [], "any", true, true, false, 25) && !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 25, $this->source); })()), "template", [], "any", false, false, false, 25)))) {
// line 26
yield "\t";
// line 41
yield "\t";
$context["them_ids"] = [];
// line 42
yield "\t";
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 42, $this->source); })()), "extension", [], "any", false, false, false, 42), "excerpt", [], "any", false, false, false, 42), "categories", [], "any", false, false, false, 42));
foreach ($context['_seq'] as $context["_key"] => $context["category"]) {
// line 43
yield "\t\t";
$context["them_ids"] = Twig\Extension\CoreExtension::merge((isset($context["them_ids"]) || array_key_exists("them_ids", $context) ? $context["them_ids"] : (function () { throw new RuntimeError('Variable "them_ids" does not exist.', 43, $this->source); })()), [CoreExtension::getAttribute($this->env, $this->source, $context["category"], "id", [], "any", false, false, false, 43)]);
// line 44
yield "\t";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['category'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 45
yield "\t";
$context["categoryColor"] = "";
// line 46
yield "\t";
if ((CoreExtension::getAttribute($this->env, $this->source, ($context["them_ids"] ?? null), 0, [], "array", true, true, false, 46) && !(null === CoreExtension::getAttribute($this->env, $this->source, (isset($context["them_ids"]) || array_key_exists("them_ids", $context) ? $context["them_ids"] : (function () { throw new RuntimeError('Variable "them_ids" does not exist.', 46, $this->source); })()), 0, [], "array", false, false, false, 46)))) {
// line 47
yield "\t\t";
$context["categoryColor"] = CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $this->extensions['App\Twig\LoadCategoriesByIdsExtension']->fetchCategory(CoreExtension::getAttribute($this->env, $this->source, (isset($context["them_ids"]) || array_key_exists("them_ids", $context) ? $context["them_ids"] : (function () { throw new RuntimeError('Variable "them_ids" does not exist.', 47, $this->source); })()), 0, [], "array", false, false, false, 47), "fr"), "entity", [], "any", false, false, false, 47), "color", [], "any", false, false, false, 47);
// line 48
yield "\t";
}
// line 49
yield "\t";
if ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["article"] ?? null), "content", [], "any", false, true, false, 49), "main_category", [], "any", true, true, false, 49) && !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 49, $this->source); })()), "content", [], "any", false, false, false, 49), "main_category", [], "any", false, false, false, 49)))) {
// line 50
yield "\t\t";
$context["categoryColor"] = CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $this->extensions['App\Twig\LoadCategoriesByIdsExtension']->fetchCategory(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 50, $this->source); })()), "content", [], "any", false, false, false, 50), "main_category", [], "any", false, false, false, 50), "id", [], "any", false, false, false, 50), "fr"), "entity", [], "any", false, false, false, 50), "color", [], "any", false, false, false, 50);
// line 51
yield "\t";
}
// line 52
yield "\t";
$context["categoryColor"] = (((isset($context["categoryColor"]) || array_key_exists("categoryColor", $context) ? $context["categoryColor"] : (function () { throw new RuntimeError('Variable "categoryColor" does not exist.', 52, $this->source); })())) ?: ("#354161"));
// line 53
yield "\t";
$context["type_territoire"] = "";
// line 54
yield "\t";
if ((CoreExtension::getAttribute($this->env, $this->source, ($context["article"] ?? null), "type_territoire", [], "any", true, true, false, 54) && !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 54, $this->source); })()), "type_territoire", [], "any", false, false, false, 54)))) {
// line 55
yield "\t\t";
$context["type_territoire"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 55, $this->source); })()), "type_territoire", [], "any", false, false, false, 55);
// line 56
yield "\t";
}
// line 57
yield "
\t<div class=\"preview-container ";
// line 58
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 58, $this->source); })()), "template", [], "any", false, false, false, 58), "html", null, true);
yield " br8 dflex fdc\" data-uuid=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 58, $this->source); })()), "uuid", [], "any", false, false, false, 58), "html", null, true);
yield "\" data-theme=\"";
yield json_encode((isset($context["them_ids"]) || array_key_exists("them_ids", $context) ? $context["them_ids"] : (function () { throw new RuntimeError('Variable "them_ids" does not exist.', 58, $this->source); })()));
yield "\" data-main-color=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["categoryColor"]) || array_key_exists("categoryColor", $context) ? $context["categoryColor"] : (function () { throw new RuntimeError('Variable "categoryColor" does not exist.', 58, $this->source); })()), "html", null, true);
yield "\" ";
if ((CoreExtension::getAttribute($this->env, $this->source, ($context["article"] ?? null), "content", [], "any", true, true, false, 58) && CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["article"] ?? null), "content", [], "any", false, true, false, 58), "title", [], "any", true, true, false, 58))) {
yield " data-title=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 58, $this->source); })()), "content", [], "any", false, false, false, 58), "title", [], "any", false, false, false, 58), "html", null, true);
yield "\" ";
}
yield " ";
if (((CoreExtension::getAttribute($this->env, $this->source, ($context["article"] ?? null), "content", [], "any", true, true, false, 58) && CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["article"] ?? null), "content", [], "any", false, true, false, 58), "adresse", [], "any", true, true, false, 58)) && !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 58, $this->source); })()), "content", [], "any", false, false, false, 58), "adresse", [], "any", false, false, false, 58)))) {
yield " data-lat=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 58, $this->source); })()), "content", [], "any", false, false, false, 58), "adresse", [], "any", false, false, false, 58), 1, [], "array", false, false, false, 58), "html", null, true);
yield "\" data-long=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 58, $this->source); })()), "content", [], "any", false, false, false, 58), "adresse", [], "any", false, false, false, 58), 2, [], "array", false, false, false, 58), "html", null, true);
yield "\" ";
}
yield " ";
if ((CoreExtension::getAttribute($this->env, $this->source, ($context["article"] ?? null), "content", [], "any", true, true, false, 58) && CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["article"] ?? null), "content", [], "any", false, true, false, 58), "type_territoire", [], "any", true, true, false, 58))) {
yield " data-type=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 58, $this->source); })()), "content", [], "any", false, false, false, 58), "type_territoire", [], "any", false, false, false, 58), "html", null, true);
yield "\" ";
}
yield " ";
if (((CoreExtension::getAttribute($this->env, $this->source, ($context["article"] ?? null), "content", [], "any", true, true, false, 58) && CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["article"] ?? null), "content", [], "any", false, true, false, 58), "header_img", [], "any", true, true, false, 58)) && !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 58, $this->source); })()), "content", [], "any", false, false, false, 58), "header_img", [], "any", false, false, false, 58)))) {
yield " data-header-img=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 58, $this->source); })()), "content", [], "any", false, false, false, 58), "header_img", [], "any", false, false, false, 58), "url", [], "any", false, false, false, 58), "html", null, true);
yield "\" ";
}
yield " ";
if (((CoreExtension::getAttribute($this->env, $this->source, ($context["article"] ?? null), "content", [], "any", true, true, false, 58) && CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["article"] ?? null), "content", [], "any", false, true, false, 58), "departement", [], "any", true, true, false, 58)) && !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 58, $this->source); })()), "content", [], "any", false, false, false, 58), "departement", [], "any", false, false, false, 58)))) {
yield " data-departement=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 58, $this->source); })()), "content", [], "any", false, false, false, 58), "departement", [], "any", false, false, false, 58), "html", null, true);
yield "\" ";
}
yield " ";
if (((0 === CoreExtension::compare(CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 58, $this->source); })()), "template", [], "any", false, false, false, 58), "experiences")) || (0 === CoreExtension::compare(CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 58, $this->source); })()), "template", [], "any", false, false, false, 58), "fiches_territoires")))) {
yield " data-html=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(base64_encode(json_encode(Twig\Extension\CoreExtension::include($this->env, $context, "api/api_experience_search.html.twig", ["header_img" => CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 58, $this->source); })()), "content", [], "any", false, false, false, 58), "header_img", [], "any", false, false, false, 58), "categories" => (isset($context["them_ids"]) || array_key_exists("them_ids", $context) ? $context["them_ids"] : (function () { throw new RuntimeError('Variable "them_ids" does not exist.', 58, $this->source); })()), "departement" => CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 58, $this->source); })()), "content", [], "any", false, false, false, 58), "departement", [], "any", false, false, false, 58), "title" => (isset($context["title"]) || array_key_exists("title", $context) ? $context["title"] : (function () { throw new RuntimeError('Variable "title" does not exist.', 58, $this->source); })()), "url" => (isset($context["routePath"]) || array_key_exists("routePath", $context) ? $context["routePath"] : (function () { throw new RuntimeError('Variable "routePath" does not exist.', 58, $this->source); })())]))), "html", null, true);
yield "\" ";
}
yield ">
\t\t";
// line 59
if ((((0 === CoreExtension::compare(CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 59, $this->source); })()), "template", [], "any", false, false, false, 59), "articles")) || (0 === CoreExtension::compare(CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 59, $this->source); })()), "template", [], "any", false, false, false, 59), "analyses"))) || (0 === CoreExtension::compare(CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 59, $this->source); })()), "template", [], "any", false, false, false, 59), "guides_outils")))) {
// line 60
yield "\t\t\t";
yield from $this->loadTemplate("api/blocks/articles-preview-content.html.twig", "api/blocks/api_search_render.html.twig", 60)->unwrap()->yield($context);
// line 61
yield "\t\t";
} elseif ((0 === CoreExtension::compare(CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 61, $this->source); })()), "template", [], "any", false, false, false, 61), "agenda"))) {
// line 62
yield "\t\t\t";
yield from $this->loadTemplate("api/blocks/agenda-preview-content.html.twig", "api/blocks/api_search_render.html.twig", 62)->unwrap()->yield($context);
// line 63
yield "\t\t";
} elseif ((0 === CoreExtension::compare(CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 63, $this->source); })()), "template", [], "any", false, false, false, 63), "newsletters"))) {
// line 64
yield "\t\t\t";
yield from $this->loadTemplate("api/blocks/newsletters-preview-content.html.twig", "api/blocks/api_search_render.html.twig", 64)->unwrap()->yield($context);
// line 65
yield "\t\t";
} elseif ((0 === CoreExtension::compare(CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 65, $this->source); })()), "template", [], "any", false, false, false, 65), "offres"))) {
// line 66
yield "\t\t\t";
yield from $this->loadTemplate("api/blocks/offres-preview-content.html.twig", "api/blocks/api_search_render.html.twig", 66)->unwrap()->yield($context);
// line 67
yield "\t\t";
} elseif ((0 === CoreExtension::compare(CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 67, $this->source); })()), "template", [], "any", false, false, false, 67), "aapami"))) {
// line 68
yield "\t\t\t";
yield from $this->loadTemplate("api/blocks/aapami-preview-content.html.twig", "api/blocks/api_search_render.html.twig", 68)->unwrap()->yield($context);
// line 69
yield "\t\t";
} elseif ((0 === CoreExtension::compare(CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 69, $this->source); })()), "template", [], "any", false, false, false, 69), "fiches_territoires"))) {
// line 70
yield " ";
if ((array_key_exists("isSearch", $context) && (isset($context["isSearch"]) || array_key_exists("isSearch", $context) ? $context["isSearch"] : (function () { throw new RuntimeError('Variable "isSearch" does not exist.', 70, $this->source); })()))) {
// line 71
yield "\t\t\t\t";
yield from $this->loadTemplate("api/blocks/territory-only-preview.html.twig", "api/blocks/api_search_render.html.twig", 71)->unwrap()->yield($context);
// line 72
yield "\t\t\t";
} else {
// line 73
yield "\t\t\t ";
yield from $this->loadTemplate("api/blocks/territoire-preview-content.html.twig", "api/blocks/api_search_render.html.twig", 73)->unwrap()->yield($context);
// line 74
yield "\t\t\t";
}
// line 75
yield "\t\t";
} elseif ((0 === CoreExtension::compare(CoreExtension::getAttribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 75, $this->source); })()), "template", [], "any", false, false, false, 75), "experiences"))) {
// line 76
yield "\t\t\t";
if ((array_key_exists("isSearch", $context) && (isset($context["isSearch"]) || array_key_exists("isSearch", $context) ? $context["isSearch"] : (function () { throw new RuntimeError('Variable "isSearch" does not exist.', 76, $this->source); })()))) {
// line 77
yield "\t\t\t\t";
yield from $this->loadTemplate("api/blocks/experience-only-preview.html.twig", "api/blocks/api_search_render.html.twig", 77)->unwrap()->yield($context);
// line 78
yield "\t\t\t";
} else {
// line 79
yield "\t\t\t\t";
yield from $this->loadTemplate("api/blocks/experience-map-preview.html.twig", "api/blocks/api_search_render.html.twig", 79)->unwrap()->yield($context);
// line 80
yield "\t\t\t";
}
// line 81
yield "\t\t";
}
// line 82
yield "\t</div>
";
}
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
return; yield '';
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName()
{
return "api/blocks/api_search_render.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable()
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo()
{
return array ( 268 => 82, 265 => 81, 262 => 80, 259 => 79, 256 => 78, 253 => 77, 250 => 76, 247 => 75, 244 => 74, 241 => 73, 238 => 72, 235 => 71, 232 => 70, 229 => 69, 226 => 68, 223 => 67, 220 => 66, 217 => 65, 214 => 64, 211 => 63, 208 => 62, 205 => 61, 202 => 60, 200 => 59, 152 => 58, 149 => 57, 146 => 56, 143 => 55, 140 => 54, 137 => 53, 134 => 52, 131 => 51, 128 => 50, 125 => 49, 122 => 48, 119 => 47, 116 => 46, 113 => 45, 107 => 44, 104 => 43, 99 => 42, 96 => 41, 94 => 26, 92 => 25, 89 => 24, 85 => 22, 83 => 21, 79 => 19, 77 => 18, 73 => 16, 71 => 15, 67 => 13, 65 => 12, 61 => 10, 59 => 9, 55 => 7, 53 => 6, 49 => 4, 47 => 3, 46 => 2, 44 => 1,);
}
public function getSourceContext()
{
return new Source("{% set article = sulu_content_load(id) %}
{% if article.author is defined and article.author is not empty and
\tarticle.author.contact is defined and article.author.contact is not empty %}
\t{% set author = sulu_resolve_user(article.author).contact.fullName %}
{% endif %}
{% if article.content is defined and article.content is not empty %}
\t{% set articleContent = article.content %}
{% endif %}
{% if article.extension.excerpt.categories is defined and article.extension.excerpt.categories is not empty %}
\t{% set categories = article.extension.excerpt.categories %}
{% endif %}
{% if articleContent.chapo is defined and articleContent.chapo is not empty %}
\t{% set chapo = articleContent.chapo %}
{% endif %}
{% if articleContent.routePath is defined and articleContent.routePath is not empty %}
\t{% set routePath = articleContent.routePath %}
{% endif %}
{% if articleContent.title is defined and articleContent.title is not empty %}
\t{% set title = articleContent.title %}
{% endif %}
{% if articleContent.front_title is defined and articleContent.front_title is not empty %}
\t{% set title = articleContent.front_title %}
{% endif %}
{% if article.template is defined and article.template is not empty %}
\t{#
\t\t category = {
\t\t id: number,
\t\t key: string,
\t\t name: string,
\t\t description: ?string,
\t\t meta: array,
\t\t keywords: array,
\t\t defaultLocale: string,
\t\t creator: string,
\t\t changer: string,
\t\t created: Datetime,
\t\t changed: Datetime
\t\t }
\t\t #}
\t{% set them_ids = [] %}
\t{% for category in article.extension.excerpt.categories %}
\t\t{% set them_ids = them_ids|merge([category.id]) %}
\t{% endfor %}
\t{% set categoryColor = '' %}
\t{% if them_ids[0] is defined and them_ids[0] is not null %}
\t\t{% set categoryColor = load_category_by_id(them_ids[0], 'fr').entity.color %}
\t{% endif %}
\t{% if article.content.main_category is defined and article.content.main_category is not empty %}
\t\t{% set categoryColor = load_category_by_id(article.content.main_category.id, 'fr').entity.color %}
\t{% endif %}
\t{% set categoryColor = categoryColor ?: '#354161' %}
\t{% set type_territoire = '' %}
\t{% if article.type_territoire is defined and article.type_territoire is not empty %}
\t\t{% set type_territoire = article.type_territoire %}
\t{% endif %}
\t<div class=\"preview-container {{ article.template }} br8 dflex fdc\" data-uuid=\"{{ article.uuid }}\" data-theme=\"{{them_ids|json_encode|raw}}\" data-main-color=\"{{ categoryColor }}\" {% if article.content is defined and article.content.title is defined %} data-title=\"{{ article.content.title }}\" {% endif %} {% if article.content is defined and article.content.adresse is defined and article.content.adresse is not empty %} data-lat=\"{{ article.content.adresse[1] }}\" data-long=\"{{ article.content.adresse[2] }}\" {% endif %} {% if article.content is defined and article.content.type_territoire is defined %} data-type=\"{{ article.content.type_territoire }}\" {% endif %} {% if article.content is defined and article.content.header_img is defined and article.content.header_img is not empty %} data-header-img=\"{{ article.content.header_img.url }}\" {% endif %} {% if article.content is defined and article.content.departement is defined and article.content.departement is not empty %} data-departement=\"{{ article.content.departement }}\" {% endif %} {% if article.template == \"experiences\" or article.template == \"fiches_territoires\" %} data-html=\"{{ include('api/api_experience_search.html.twig', { header_img: article.content.header_img, categories: them_ids, departement: article.content.departement, title: title, url: routePath }) | json_encode | base64_encode }}\" {% endif %}>
\t\t{% if article.template == \"articles\" or article.template == \"analyses\" or article.template == \"guides_outils\" %}
\t\t\t{% include \"api/blocks/articles-preview-content.html.twig\" %}
\t\t{% elseif article.template == \"agenda\" %}
\t\t\t{% include \"api/blocks/agenda-preview-content.html.twig\" %}
\t\t{% elseif article.template == \"newsletters\" %}
\t\t\t{% include \"api/blocks/newsletters-preview-content.html.twig\" %}
\t\t{% elseif article.template == \"offres\" %}
\t\t\t{% include \"api/blocks/offres-preview-content.html.twig\" %}
\t\t{% elseif article.template == \"aapami\" %}
\t\t\t{% include \"api/blocks/aapami-preview-content.html.twig\" %}
\t\t{% elseif article.template == \"fiches_territoires\" %}
{% if isSearch is defined and isSearch %}
\t\t\t\t{% include \"api/blocks/territory-only-preview.html.twig\" %}
\t\t\t{% else %}
\t\t\t {% include \"api/blocks/territoire-preview-content.html.twig\" %}
\t\t\t{% endif %}
\t\t{% elseif article.template == \"experiences\" %}
\t\t\t{% if isSearch is defined and isSearch %}
\t\t\t\t{% include \"api/blocks/experience-only-preview.html.twig\" %}
\t\t\t{% else %}
\t\t\t\t{% include \"api/blocks/experience-map-preview.html.twig\" %}
\t\t\t{% endif %}
\t\t{% endif %}
\t</div>
{% endif %}
", "api/blocks/api_search_render.html.twig", "/var/www/html/templates/api/blocks/api_search_render.html.twig");
}
}