templates/article/articles_par_categorie.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}Articles de la catégorie {{ categorie.name }}{% endblock %}
  3. {% block body %}
  4. <div style="display: flex; justify-content: center; margin: 15px; width:70%; height: auto; border: 2px solid white; border-radius: 10px; padding: 20px;">
  5.     <div style="width: 100%;">
  6.         <h1 style="text-align: center;">Articles de la catégorie "{{ categorie.name }}"</h1>
  7.         <br>
  8.         <ul style="list-style: none; padding: 0;">
  9.             {% for article in articles %}
  10.                 <!-- Ternaire 1 sur 2 articles sera en transparent et l'autre en bleu-->
  11.                 <li style="margin-bottom: 10px; padding: 10px; {% if loop.index is odd %}background-color: #5ED9F4;{% endif %}">
  12.                     <a href="{{ path('app_affiche_un_post', { 'id': firstPostByArticle[article.id] ? firstPostByArticle[article.id].id : 0 }) }}" 
  13.                        style="font-size: 30px; text-decoration: none; color: black;">{{ article.title }}</a>
  14.                 </li>
  15.             {% endfor %}
  16.         </ul>
  17.     </div>
  18. </div>
  19. {% endblock %}