var/cache/dev/twig/9c/9c6ec5af7ffa30906bb997a98d1a643b.php line 81

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\SandboxExtension;
  6. use Twig\Markup;
  7. use Twig\Sandbox\SecurityError;
  8. use Twig\Sandbox\SecurityNotAllowedTagError;
  9. use Twig\Sandbox\SecurityNotAllowedFilterError;
  10. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  11. use Twig\Source;
  12. use Twig\Template;
  13. /* front/blog/_blog-card.html.twig */
  14. class __TwigTemplate_643e8ee63a3b963e084d32d6f3910e84 extends Template
  15. {
  16.     private $source;
  17.     private $macros = [];
  18.     public function __construct(Environment $env)
  19.     {
  20.         parent::__construct($env);
  21.         $this->source $this->getSourceContext();
  22.         $this->parent false;
  23.         $this->blocks = [
  24.         ];
  25.     }
  26.     protected function doDisplay(array $context, array $blocks = [])
  27.     {
  28.         $macros $this->macros;
  29.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  30.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""front/blog/_blog-card.html.twig"));
  31.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  32.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""front/blog/_blog-card.html.twig"));
  33.         // line 1
  34.         echo "<div class=\"blog-card\">
  35. \t<a href=\"";
  36.         // line 2
  37.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("show_article", ["slug" => twig_get_attribute($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); })()), "slug", [], "any"falsefalsefalse2)]), "html"nulltrue);
  38.         echo "\">
  39. \t<div class=\"blog-card-img\">
  40. \t\t<img loading=\"lazy\" src=\"";
  41.         // line 4
  42.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(("/images/blog/" twig_get_attribute($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); })()), "cover", [], "any"falsefalsefalse4))), "html"nulltrue);
  43.         echo "\" alt=\"";
  44.         echo twig_escape_filter($this->envtwig_get_attribute($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); })()), "altCover", [], "any"falsefalsefalse4), "html"nulltrue);
  45.         echo "\"/>
  46. \t\t<div class=\"categories-wrap\">
  47. \t\t\t";
  48.         // line 6
  49.         $context['_parent'] = $context;
  50.         $context['_seq'] = twig_ensure_traversable(twig_get_attribute($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); })()), "categories", [], "any"falsefalsefalse6));
  51.         $context['loop'] = [
  52.           'parent' => $context['_parent'],
  53.           'index0' => 0,
  54.           'index'  => 1,
  55.           'first'  => true,
  56.         ];
  57.         if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
  58.             $length count($context['_seq']);
  59.             $context['loop']['revindex0'] = $length 1;
  60.             $context['loop']['revindex'] = $length;
  61.             $context['loop']['length'] = $length;
  62.             $context['loop']['last'] = === $length;
  63.         }
  64.         foreach ($context['_seq'] as $context["_key"] => $context["category"]) {
  65.             // line 7
  66.             echo "\t\t\t\t";
  67.             if ((twig_get_attribute($this->env$this->source$context["loop"], "index", [], "any"falsefalsefalse7) <= 2)) {
  68.                 // line 8
  69.                 echo "
  70. \t\t\t\t\t";
  71.                 // line 9
  72.                 $context["articleCategoryInfos"] = $this->extensions['App\Twig\AppExtension']->articleCategoryInfos($context["category"], twig_get_attribute($this->env$this->sourcetwig_get_attribute($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"falsefalsefalse9), "locale", [], "any"falsefalsefalse9));
  73.                 // line 10
  74.                 echo "
  75. \t\t\t\t\t<a href=\"";
  76.                 // line 11
  77.                 echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source, (isset($context["articleCategoryInfos"]) || array_key_exists("articleCategoryInfos"$context) ? $context["articleCategoryInfos"] : (function () { throw new RuntimeError('Variable "articleCategoryInfos" does not exist.'11$this->source); })()), "link", [], "any"falsefalsefalse11), "html"nulltrue);
  78.                 echo "\" class=\"category-item\">";
  79.                 echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source, (isset($context["articleCategoryInfos"]) || array_key_exists("articleCategoryInfos"$context) ? $context["articleCategoryInfos"] : (function () { throw new RuntimeError('Variable "articleCategoryInfos" does not exist.'11$this->source); })()), "title", [], "any"falsefalsefalse11), "html"nulltrue);
  80.                 echo "</a>
  81. \t\t\t\t";
  82.             }
  83.             // line 13
  84.             echo "\t\t\t";
  85.             ++$context['loop']['index0'];
  86.             ++$context['loop']['index'];
  87.             $context['loop']['first'] = false;
  88.             if (isset($context['loop']['length'])) {
  89.                 --$context['loop']['revindex0'];
  90.                 --$context['loop']['revindex'];
  91.                 $context['loop']['last'] = === $context['loop']['revindex0'];
  92.             }
  93.         }
  94.         $_parent $context['_parent'];
  95.         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['category'], $context['_parent'], $context['loop']);
  96.         $context array_intersect_key($context$_parent) + $_parent;
  97.         // line 14
  98.         echo "\t\t</div>
  99. \t\t<a href=\"";
  100.         // line 15
  101.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("show_article", ["slug" => twig_get_attribute($this->env$this->source, (isset($context["article"]) || array_key_exists("article"$context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.'15$this->source); })()), "slug", [], "any"falsefalsefalse15)]), "html"nulltrue);
  102.         echo "\">
  103. \t\t\t<div class=\"blog-card-image-after\"></div>
  104. \t\t</a>
  105. \t</div>
  106. \t<div class=\"blog-card-preview\">
  107. \t\t<div class=\"blog-author\">
  108. \t\t\t
  109. \t\t\t<h2 class=\"blog-title\">
  110.                 <a href=\"";
  111.         // line 23
  112.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("show_article", ["slug" => twig_get_attribute($this->env$this->source, (isset($context["article"]) || array_key_exists("article"$context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.'23$this->source); })()), "slug", [], "any"falsefalsefalse23)]), "html"nulltrue);
  113.         echo "\">
  114.                     ";
  115.         // line 24
  116.         echo twig_get_attribute($this->env$this->source, (isset($context["article"]) || array_key_exists("article"$context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.'24$this->source); })()), "title", [], "any"falsefalsefalse24);
  117.         echo "
  118.                 </a>
  119.             </h2>
  120. \t\t\t<div class=\"preview-content\">
  121. \t\t\t\t<div class=\"extract\">
  122. \t\t\t\t\t";
  123.         // line 29
  124.         echo twig_slice($this->envtwig_striptags(twig_get_attribute($this->env$this->source, (isset($context["article"]) || array_key_exists("article"$context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.'29$this->source); })()), "description", [], "any"falsefalsefalse29)), 0600);
  125.         echo "
  126. \t\t\t\t</div>
  127. \t\t\t\t<a href=\"";
  128.         // line 31
  129.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("show_article", ["slug" => twig_get_attribute($this->env$this->source, (isset($context["article"]) || array_key_exists("article"$context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.'31$this->source); })()), "slug", [], "any"falsefalsefalse31)]), "html"nulltrue);
  130.         echo "\" class=\"read-more\">";
  131.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("blog.read_more"), "html"nulltrue);
  132.         echo "</a>
  133. \t\t\t</div>
  134. \t\t</div>
  135. \t</div>
  136. \t</a>
  137. </div>
  138. ";
  139.         
  140.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  141.         
  142.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  143.     }
  144.     /**
  145.      * @codeCoverageIgnore
  146.      */
  147.     public function getTemplateName()
  148.     {
  149.         return "front/blog/_blog-card.html.twig";
  150.     }
  151.     /**
  152.      * @codeCoverageIgnore
  153.      */
  154.     public function isTraitable()
  155.     {
  156.         return false;
  157.     }
  158.     /**
  159.      * @codeCoverageIgnore
  160.      */
  161.     public function getDebugInfo()
  162.     {
  163.         return array (  138 => 31,  133 => 29,  125 => 24,  121 => 23,  110 => 15,  107 => 14,  93 => 13,  86 => 11,  83 => 10,  81 => 9,  78 => 8,  75 => 7,  58 => 6,  51 => 4,  46 => 2,  43 => 1,);
  164.     }
  165.     public function getSourceContext()
  166.     {
  167.         return new Source("<div class=\"blog-card\">
  168. \t<a href=\"{{ path('show_article', {'slug': article.slug}) }}\">
  169. \t<div class=\"blog-card-img\">
  170. \t\t<img loading=\"lazy\" src=\"{{asset('/images/blog/' ~ article.cover) }}\" alt=\"{{ article.altCover }}\"/>
  171. \t\t<div class=\"categories-wrap\">
  172. \t\t\t{% for category in article.categories %}
  173. \t\t\t\t{% if loop.index <= 2 %}
  174. \t\t\t\t\t{% set articleCategoryInfos = articleCategoryInfos(category, app.request.locale) %}
  175. \t\t\t\t\t<a href=\"{{ articleCategoryInfos.link }}\" class=\"category-item\">{{ articleCategoryInfos.title }}</a>
  176. \t\t\t\t{% endif %}
  177. \t\t\t{% endfor %}
  178. \t\t</div>
  179. \t\t<a href=\"{{ path('show_article', {'slug': article.slug}) }}\">
  180. \t\t\t<div class=\"blog-card-image-after\"></div>
  181. \t\t</a>
  182. \t</div>
  183. \t<div class=\"blog-card-preview\">
  184. \t\t<div class=\"blog-author\">
  185. \t\t\t
  186. \t\t\t<h2 class=\"blog-title\">
  187.                 <a href=\"{{ path('show_article', {'slug': article.slug}) }}\">
  188.                     {{ article.title | raw }}
  189.                 </a>
  190.             </h2>
  191. \t\t\t<div class=\"preview-content\">
  192. \t\t\t\t<div class=\"extract\">
  193. \t\t\t\t\t{{ article.description | striptags | slice (0, 600) | raw}}
  194. \t\t\t\t</div>
  195. \t\t\t\t<a href=\"{{ path('show_article', {'slug': article.slug}) }}\" class=\"read-more\">{{ 'blog.read_more' | trans }}</a>
  196. \t\t\t</div>
  197. \t\t</div>
  198. \t</div>
  199. \t</a>
  200. </div>
  201. ""front/blog/_blog-card.html.twig""/var/www/preprod/racket-trip/templates/front/blog/_blog-card.html.twig");
  202.     }
  203. }