<?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;
/* Layout/_news.html.twig */
class __TwigTemplate_af335bde92a21fa1dbbce609e4e7528a 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", "Layout/_news.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "Layout/_news.html.twig"));
// line 1
if ((Twig\Extension\CoreExtension::length($this->env->getCharset(), $this->extensions['IUTUDC\WebsiteBundle\Twig\FunctionTwigExtension']->getLastNews()) > 0)) {
// line 2
yield " <section class=\"news\">
<div class=\"container\">
<div class=\"row\">
<div class=\"col\">
<h1 class=\"t-light section-title\">News & Evenements</h1>
</div>
</div>
<div class=\"row\">
";
// line 11
$context["count"] = 0;
// line 12
yield " ";
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable($this->extensions['IUTUDC\WebsiteBundle\Twig\FunctionTwigExtension']->getLastNews());
foreach ($context['_seq'] as $context["_key"] => $context["article"]) {
// line 13
yield " ";
$context["articlenode"] = $this->extensions['Kunstmaan\NodeBundle\Twig\NodeTwigExtension']->getNodeTranslationFor($context["article"]);
// line 14
yield " <div class=\"col-sm\">
<div class=\"block-event\">
";
// line 16
if ( !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, $context["article"], "image", [], "any", false, false, false, 16))) {
// line 17
yield " <div class=\"event-img\">
<a href=\"";
// line 18
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["articlenode"]) || array_key_exists("articlenode", $context) ? $context["articlenode"] : (function () { throw new RuntimeError('Variable "articlenode" does not exist.', 18, $this->source); })()), "url", [], "any", false, false, false, 18), "html", null, true);
yield "\"><img src=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["article"], "image", [], "any", false, false, false, 18), "url", [], "any", false, false, false, 18)), "html", null, true);
yield "\" ";
if ( !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, $context["article"], "imageAltText", [], "any", false, false, false, 18))) {
yield "alt=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["article"], "imageAltText", [], "any", false, false, false, 18), "html", null, true);
yield "\"";
}
yield " /></a>
</div>
";
}
// line 21
yield " <div class=\"event-caption c-";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["count"]) || array_key_exists("count", $context) ? $context["count"] : (function () { throw new RuntimeError('Variable "count" does not exist.', 21, $this->source); })()), "html", null, true);
yield "\">
<h3 class=\"event-title\">";
// line 22
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["article"], "title", [], "any", false, false, false, 22), "html", null, true);
yield "</h3>
<div class=\"event-text\">
<p>
";
// line 25
yield $this->extensions['Kunstmaan\NodeBundle\Twig\UrlReplaceTwigExtension']->replaceUrl(Twig\Extension\CoreExtension::slice($this->env->getCharset(), CoreExtension::getAttribute($this->env, $this->source, $context["article"], "summary", [], "any", false, false, false, 25), 0, 70));
yield "
</p>
</div>
<div class=\"event-footer\">
<a href=\"";
// line 29
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["articlenode"]) || array_key_exists("articlenode", $context) ? $context["articlenode"] : (function () { throw new RuntimeError('Variable "articlenode" does not exist.', 29, $this->source); })()), "url", [], "any", false, false, false, 29), "html", null, true);
yield "\">Lire plus</a>
</div>
</div>
</div>
</div>
";
// line 34
$context["count"] = ((isset($context["count"]) || array_key_exists("count", $context) ? $context["count"] : (function () { throw new RuntimeError('Variable "count" does not exist.', 34, $this->source); })()) + 1);
// line 35
yield " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['article'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 36
yield " </div>
<div class=\"row\">
<div class=\"col a-plus\">
";
// line 39
$context["newsPageNode"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["nodemenu"]) || array_key_exists("nodemenu", $context) ? $context["nodemenu"] : (function () { throw new RuntimeError('Variable "nodemenu" does not exist.', 39, $this->source); })()), "getNodeByInternalName", ["news"], "method", false, false, false, 39);
// line 40
yield " <a href=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("_slug", ["url" => CoreExtension::getAttribute($this->env, $this->source, (isset($context["newsPageNode"]) || array_key_exists("newsPageNode", $context) ? $context["newsPageNode"] : (function () { throw new RuntimeError('Variable "newsPageNode" does not exist.', 40, $this->source); })()), "slug", [], "any", false, false, false, 40)]), "html", null, true);
yield "\">Plus de news</a>
</div>
</div>
</div>
</section>
";
}
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
yield from [];
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "Layout/_news.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable(): bool
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
return array ( 135 => 40, 133 => 39, 128 => 36, 122 => 35, 120 => 34, 112 => 29, 105 => 25, 99 => 22, 94 => 21, 80 => 18, 77 => 17, 75 => 16, 71 => 14, 68 => 13, 63 => 12, 61 => 11, 50 => 2, 48 => 1,);
}
public function getSourceContext(): Source
{
return new Source("{% if get_last_news()|length > 0 %}
<section class=\"news\">
<div class=\"container\">
<div class=\"row\">
<div class=\"col\">
<h1 class=\"t-light section-title\">News & Evenements</h1>
</div>
</div>
<div class=\"row\">
{% set count = 0 %}
{% for article in get_last_news() %}
{% set articlenode = get_node_translation_for(article) %}
<div class=\"col-sm\">
<div class=\"block-event\">
{% if article.image is not empty %}
<div class=\"event-img\">
<a href=\"{{ articlenode.url }}\"><img src=\"{{ asset(article.image.url) }}\" {% if article.imageAltText is not empty %}alt=\"{{ article.imageAltText }}\"{% endif %} /></a>
</div>
{% endif %}
<div class=\"event-caption c-{{ count }}\">
<h3 class=\"event-title\">{{ article.title }}</h3>
<div class=\"event-text\">
<p>
{{ article.summary|slice(0,70)|replace_url|raw }}
</p>
</div>
<div class=\"event-footer\">
<a href=\"{{ articlenode.url }}\">Lire plus</a>
</div>
</div>
</div>
</div>
{% set count = count + 1 %}
{% endfor %}
</div>
<div class=\"row\">
<div class=\"col a-plus\">
{% set newsPageNode = nodemenu.getNodeByInternalName('news') %}
<a href=\"{{ path('_slug', { 'url': newsPageNode.slug }) }}\">Plus de news</a>
</div>
</div>
</div>
</section>
{% endif %}", "Layout/_news.html.twig", "/home/u363484990/domains/iut-udc.online/public_html/templates/Layout/_news.html.twig");
}
}