<?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;
use Twig\TemplateWrapper;
/* content/spnsoren/view.html.twig */
class __TwigTemplate_04f2c7b081d23bac9f41fafc953343a4 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 = [
];
$this->sandbox = $this->extensions[SandboxExtension::class];
$this->checkSecurity();
}
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", "content/spnsoren/view.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "content/spnsoren/view.html.twig"));
// line 1
$context["items"] = $this->extensions['App\Twig\Extension\UtilsExtension']->sponsorList(5);
// line 2
yield "
";
// line 3
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["items"]) || array_key_exists("items", $context) ? $context["items"] : (function () { throw new RuntimeError('Variable "items" does not exist.', 3, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["sponsor"]) {
// line 4
yield " <div class=\"sponsor\">
<h4>
";
// line 6
if (CoreExtension::getAttribute($this->env, $this->source, $context["sponsor"], "homepage", [], "any", false, false, true, 6)) {
// line 7
yield " <a href=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->sandbox->ensureToStringAllowed(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["sponsor"], "homepage", [], "any", false, false, true, 7), "direct", [], "any", false, false, true, 7), 7, $this->source), "html", null, true);
yield "\" target=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->sandbox->ensureToStringAllowed(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["sponsor"], "homepage", [], "any", false, false, true, 7), "target", [], "any", false, false, true, 7), 7, $this->source), "html", null, true);
yield "\" title=\"Zur Homepage ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->sandbox->ensureToStringAllowed(CoreExtension::getAttribute($this->env, $this->source, $context["sponsor"], "name", [], "any", false, false, true, 7), 7, $this->source), "html", null, true);
yield "\">
";
// line 8
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->sandbox->ensureToStringAllowed(CoreExtension::getAttribute($this->env, $this->source, $context["sponsor"], "name", [], "any", false, false, true, 8), 8, $this->source), "html", null, true);
yield "
</a>
";
} else {
// line 11
yield " ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->sandbox->ensureToStringAllowed(CoreExtension::getAttribute($this->env, $this->source, $context["sponsor"], "name", [], "any", false, false, true, 11), 11, $this->source), "html", null, true);
yield "
";
}
// line 13
yield " </h4>
";
// line 15
$context["image"] = ('' === $tmp = \Twig\Extension\CoreExtension::captureOutput((function () use (&$context, $macros, $blocks) {
// line 16
yield " ";
if (CoreExtension::getAttribute($this->env, $this->source, $context["sponsor"], "logo", [], "any", false, false, true, 16)) {
// line 17
yield " <figure>
";
// line 18
yield $this->sandbox->ensureToStringAllowed(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["sponsor"], "logo", [], "any", false, false, true, 18), "thumbnail", ["sponsor-logo"], "method", false, false, true, 18), "html", [], "any", false, false, true, 18), 18, $this->source);
yield "
</figure>
";
}
// line 21
yield " ";
yield from [];
})())) ? '' : new Markup($tmp, $this->env->getCharset());
// line 22
yield " ";
if (CoreExtension::getAttribute($this->env, $this->source, $context["sponsor"], "homepage", [], "any", false, false, true, 22)) {
// line 23
yield " <a href=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->sandbox->ensureToStringAllowed(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["sponsor"], "homepage", [], "any", false, false, true, 23), "direct", [], "any", false, false, true, 23), 23, $this->source), "html", null, true);
yield "\" target=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->sandbox->ensureToStringAllowed(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["sponsor"], "homepage", [], "any", false, false, true, 23), "target", [], "any", false, false, true, 23), 23, $this->source), "html", null, true);
yield "\" title=\"Zur Homepage ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->sandbox->ensureToStringAllowed(CoreExtension::getAttribute($this->env, $this->source, $context["sponsor"], "name", [], "any", false, false, true, 23), 23, $this->source), "html", null, true);
yield "\">
";
// line 24
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->sandbox->ensureToStringAllowed((isset($context["image"]) || array_key_exists("image", $context) ? $context["image"] : (function () { throw new RuntimeError('Variable "image" does not exist.', 24, $this->source); })()), 24, $this->source), "html", null, true);
yield "
</a>
";
} else {
// line 27
yield " ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->sandbox->ensureToStringAllowed((isset($context["image"]) || array_key_exists("image", $context) ? $context["image"] : (function () { throw new RuntimeError('Variable "image" does not exist.', 27, $this->source); })()), 27, $this->source), "html", null, true);
yield "
";
}
// line 29
yield " ";
yield $this->sandbox->ensureToStringAllowed(CoreExtension::getAttribute($this->env, $this->source, $context["sponsor"], "description", [], "any", false, false, true, 29), 29, $this->source);
yield "
</div>";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['sponsor'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
yield from [];
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "content/spnsoren/view.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable(): bool
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
return array ( 132 => 29, 126 => 27, 120 => 24, 111 => 23, 108 => 22, 104 => 21, 98 => 18, 95 => 17, 92 => 16, 90 => 15, 86 => 13, 80 => 11, 74 => 8, 65 => 7, 63 => 6, 59 => 4, 55 => 3, 52 => 2, 50 => 1,);
}
public function getSourceContext(): Source
{
return new Source("{% set items = sponsorList(5) %}
{% for sponsor in items %}
<div class=\"sponsor\">
<h4>
{% if sponsor.homepage %}
<a href=\"{{ sponsor.homepage.direct }}\" target=\"{{ sponsor.homepage.target }}\" title=\"Zur Homepage {{ sponsor.name }}\">
{{ sponsor.name }}
</a>
{% else %}
{{ sponsor.name }}
{% endif %}
</h4>
{% set image %}
{% if sponsor.logo %}
<figure>
{{ sponsor.logo.thumbnail('sponsor-logo').html|raw }}
</figure>
{% endif %}
{% endset %}
{% if sponsor.homepage %}
<a href=\"{{ sponsor.homepage.direct }}\" target=\"{{ sponsor.homepage.target }}\" title=\"Zur Homepage {{ sponsor.name }}\">
{{ image }}
</a>
{% else %}
{{ image }}
{% endif %}
{{ sponsor.description|raw }}
</div>{% endfor %}
", "content/spnsoren/view.html.twig", "/var/www/vhosts/mensa-fasching.de/uat/releases/20250218080531/templates/content/spnsoren/view.html.twig");
}
public function checkSecurity()
{
static $tags = ["set" => 1, "for" => 3, "if" => 6];
static $filters = ["escape" => 7, "raw" => 18];
static $functions = ["sponsorList" => 1];
try {
$this->sandbox->checkSecurity(
['set', 'for', 'if'],
['escape', 'raw'],
['sponsorList'],
$this->source
);
} catch (SecurityError $e) {
$e->setSourceContext($this->source);
if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
$e->setTemplateLine($tags[$e->getTagName()]);
} elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
$e->setTemplateLine($filters[$e->getFilterName()]);
} elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
$e->setTemplateLine($functions[$e->getFunctionName()]);
}
throw $e;
}
}
}