<?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;
/* blocks/previews-from-controller/blocks/categories.html.twig */
class __TwigTemplate_402e44cc2c381d6acaa09337f816fec5bf59f2a91bf63ed0974bba7dd4e2e23e 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", "blocks/previews-from-controller/blocks/categories.html.twig"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "blocks/previews-from-controller/blocks/categories.html.twig"));
// line 1
if (((array_key_exists("categories", $context) && !Twig\Extension\CoreExtension::testEmpty((isset($context["categories"]) || array_key_exists("categories", $context) ? $context["categories"] : (function () { throw new RuntimeError('Variable "categories" does not exist.', 1, $this->source); })()))) && (1 === CoreExtension::compare(Twig\Extension\CoreExtension::length($this->env->getCharset(), (isset($context["categories"]) || array_key_exists("categories", $context) ? $context["categories"] : (function () { throw new RuntimeError('Variable "categories" does not exist.', 1, $this->source); })())), 0)))) {
// line 2
yield " <div class=\"thematique-container dflex fwwrap mt-8px\">
";
// line 3
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["categories"]) || array_key_exists("categories", $context) ? $context["categories"] : (function () { throw new RuntimeError('Variable "categories" does not exist.', 3, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["category"]) {
// line 4
yield " ";
if ((CoreExtension::getAttribute($this->env, $this->source, $context["category"], "id", [], "any", true, true, false, 4) && !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, $context["category"], "id", [], "any", false, false, false, 4)))) {
// line 5
yield " ";
$context["id"] = CoreExtension::getAttribute($this->env, $this->source, $context["category"], "id", [], "any", false, false, false, 5);
// line 6
yield " ";
} else {
// line 7
yield " ";
$context["id"] = $context["category"];
// line 8
yield " ";
}
// line 9
yield " ";
$context["categoryEntity"] = $this->extensions['App\Twig\LoadCategoriesByIdsExtension']->fetchCategory((isset($context["id"]) || array_key_exists("id", $context) ? $context["id"] : (function () { throw new RuntimeError('Variable "id" does not exist.', 9, $this->source); })()), CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 9, $this->source); })()), "request", [], "any", false, false, false, 9), "locale", [], "any", false, false, false, 9));
// line 10
yield " ";
if ((CoreExtension::getAttribute($this->env, $this->source, $context["category"], "name", [], "any", true, true, false, 10) && !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, $context["category"], "name", [], "any", false, false, false, 10)))) {
// line 11
yield " ";
$context["name"] = CoreExtension::getAttribute($this->env, $this->source, $context["category"], "name", [], "any", false, false, false, 11);
// line 12
yield " ";
} else {
// line 13
yield " ";
$context["name"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["categoryEntity"]) || array_key_exists("categoryEntity", $context) ? $context["categoryEntity"] : (function () { throw new RuntimeError('Variable "categoryEntity" does not exist.', 13, $this->source); })()), "name", [], "any", false, false, false, 13);
// line 14
yield " ";
}
// line 15
yield " ";
$context["pageLink"] = CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["categoryEntity"]) || array_key_exists("categoryEntity", $context) ? $context["categoryEntity"] : (function () { throw new RuntimeError('Variable "categoryEntity" does not exist.', 15, $this->source); })()), "entity", [], "any", false, false, false, 15), "pageLink", [], "any", false, false, false, 15);
// line 16
yield " ";
$context["contentLoad"] = CoreExtension::getAttribute($this->env, $this->source, $this->env->getFunction('sulu_content_load')->getCallable()(CoreExtension::getAttribute($this->env, $this->source, (isset($context["pageLink"]) || array_key_exists("pageLink", $context) ? $context["pageLink"] : (function () { throw new RuntimeError('Variable "pageLink" does not exist.', 16, $this->source); })()), "href", [], "any", false, false, false, 16)), "content", [], "any", false, false, false, 16);
// line 17
yield " ";
if ((((array_key_exists("pageLink", $context) && !Twig\Extension\CoreExtension::testEmpty((isset($context["pageLink"]) || array_key_exists("pageLink", $context) ? $context["pageLink"] : (function () { throw new RuntimeError('Variable "pageLink" does not exist.', 17, $this->source); })()))) && // line 18
array_key_exists("contentLoad", $context)) && !Twig\Extension\CoreExtension::testEmpty( // line 19
(isset($context["contentLoad"]) || array_key_exists("contentLoad", $context) ? $context["contentLoad"] : (function () { throw new RuntimeError('Variable "contentLoad" does not exist.', 19, $this->source); })())))) {
// line 20
yield " <a href=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["contentLoad"]) || array_key_exists("contentLoad", $context) ? $context["contentLoad"] : (function () { throw new RuntimeError('Variable "contentLoad" does not exist.', 20, $this->source); })()), "url", [], "any", false, false, false, 20), "html", null, true);
yield "\" class=\"nodeco them-link\">
";
}
// line 22
yield " ";
if ((array_key_exists("id", $context) && !Twig\Extension\CoreExtension::testEmpty((isset($context["id"]) || array_key_exists("id", $context) ? $context["id"] : (function () { throw new RuntimeError('Variable "id" does not exist.', 22, $this->source); })())))) {
// line 23
yield " ";
$context["color"] = CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["categoryEntity"]) || array_key_exists("categoryEntity", $context) ? $context["categoryEntity"] : (function () { throw new RuntimeError('Variable "categoryEntity" does not exist.', 23, $this->source); })()), "entity", [], "any", false, false, false, 23), "color", [], "any", false, false, false, 23);
// line 24
yield " <div class=\"thematiques-tag cwhite fw400 dflex aic\" ";
if ((array_key_exists("color", $context) && !Twig\Extension\CoreExtension::testEmpty((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 24, $this->source); })())))) {
yield " style=\"background: ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 24, $this->source); })()), "html", null, true);
yield "\" ";
}
yield ">
";
// line 25
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["name"]) || array_key_exists("name", $context) ? $context["name"] : (function () { throw new RuntimeError('Variable "name" does not exist.', 25, $this->source); })()), "html", null, true);
yield "
</div>
";
}
// line 28
yield "
";
// line 29
if ((((array_key_exists("pageLink", $context) && !Twig\Extension\CoreExtension::testEmpty((isset($context["pageLink"]) || array_key_exists("pageLink", $context) ? $context["pageLink"] : (function () { throw new RuntimeError('Variable "pageLink" does not exist.', 29, $this->source); })()))) && // line 30
array_key_exists("contentLoad", $context)) && !Twig\Extension\CoreExtension::testEmpty( // line 31
(isset($context["contentLoad"]) || array_key_exists("contentLoad", $context) ? $context["contentLoad"] : (function () { throw new RuntimeError('Variable "contentLoad" does not exist.', 31, $this->source); })())))) {
// line 32
yield " </a>
";
}
// line 34
yield " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['category'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 35
yield " </div>
";
}
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
return; yield '';
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName()
{
return "blocks/previews-from-controller/blocks/categories.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable()
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo()
{
return array ( 141 => 35, 135 => 34, 131 => 32, 129 => 31, 128 => 30, 127 => 29, 124 => 28, 118 => 25, 109 => 24, 106 => 23, 103 => 22, 97 => 20, 95 => 19, 94 => 18, 92 => 17, 89 => 16, 86 => 15, 83 => 14, 80 => 13, 77 => 12, 74 => 11, 71 => 10, 68 => 9, 65 => 8, 62 => 7, 59 => 6, 56 => 5, 53 => 4, 49 => 3, 46 => 2, 44 => 1,);
}
public function getSourceContext()
{
return new Source("{% if categories is defined and categories is not empty and categories|length > 0 %}
<div class=\"thematique-container dflex fwwrap mt-8px\">
{% for category in categories %}
{% if category.id is defined and category.id is not empty %}
{% set id = category.id %}
{% else %}
{% set id = category %}
{% endif %}
{% set categoryEntity = load_category_by_id(id, app.request.locale) %}
{% if category.name is defined and category.name is not empty %}
{% set name = category.name %}
{% else %}
{% set name = categoryEntity.name %}
{% endif %}
{% set pageLink = categoryEntity.entity.pageLink %}
{% set contentLoad = sulu_content_load(pageLink.href).content %}
{% if pageLink is defined and pageLink is not empty and
contentLoad is defined and
contentLoad is not empty %}
<a href=\"{{ contentLoad.url }}\" class=\"nodeco them-link\">
{% endif %}
{% if id is defined and id is not empty %}
{% set color = categoryEntity.entity.color %}
<div class=\"thematiques-tag cwhite fw400 dflex aic\" {% if color is defined and color is not empty %} style=\"background: {{ color }}\" {% endif %}>
{{ name }}
</div>
{% endif %}
{% if pageLink is defined and pageLink is not empty and
contentLoad is defined and
contentLoad is not empty %}
</a>
{% endif %}
{% endfor %}
</div>
{% endif %}
", "blocks/previews-from-controller/blocks/categories.html.twig", "/var/www/html/templates/blocks/previews-from-controller/blocks/categories.html.twig");
}
}