templates/blog_article/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}{{ setting.siteName }} : Blog{% endblock %}
  3. {% block body %}
  4. {# <h1>BlogArticle index</h1>
  5.     <table class="table">
  6.         <thead>
  7.             <tr>
  8.                 <th>Id</th>
  9.                 <th>Title</th>
  10.                 <th>Content</th>
  11.                 <th>Image</th>
  12.                 <th>Video</th>
  13.                 <th>CreatedAt</th>
  14.                 <th>UpdatedAt</th>
  15.                 <th>IsEnabled</th>
  16.                 <th>Slug</th>
  17.                 <th>actions</th>
  18.             </tr>
  19.         </thead>
  20.         <tbody>
  21.         {% for blog_article in blog_articles %}
  22.             <tr>
  23.                 <td>{{ blog_article.id }}</td>
  24.                 <td>{{ blog_article.title }}</td>
  25.                 <td>{{ blog_article.content }}</td>
  26.                 <td>{{ blog_article.image }}</td>
  27.                 <td>{{ blog_article.video }}</td>
  28.                 <td>{{ blog_article.createdAt ? blog_article.createdAt|date('Y-m-d H:i:s') : '' }}</td>
  29.                 <td>{{ blog_article.updatedAt ? blog_article.updatedAt|date('Y-m-d H:i:s') : '' }}</td>
  30.                 <td>{{ blog_article.isEnabled ? 'Yes' : 'No' }}</td>
  31.                 <td>{{ blog_article.slug }}</td>
  32.                 <td>
  33.                     <a href="{{ path('app_blog_article_show', {'id': blog_article.id}) }}">show</a>
  34.                     <a href="{{ path('app_blog_article_edit', {'id': blog_article.id}) }}">edit</a>
  35.                 </td>
  36.             </tr>
  37.         {% else %}
  38.             <tr>
  39.                 <td colspan="10">no records found</td>
  40.             </tr>
  41.         {% endfor %}
  42.         </tbody>
  43.     </table>
  44.     <a href="{{ path('app_blog_article_new') }}">Create new</a> #}
  45. <section class="container py-5">
  46.     <div class="row">
  47.         <div class="col">
  48.             {# Breadcrumbs #}
  49.             <div class="row">
  50.                 <div class="col small">
  51.                     <nav style="--bs-breadcrumb-divider: url(&#34;data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M2.5 0L1 1.5 3.5 4 1 6.5 2.5 8l4-4-4-4z' fill='%236c757d'/%3E%3C/svg%3E&#34;);"
  52.                         aria-label="breadcrumb">
  53.                         <ol class="breadcrumb small">
  54.                             <li class="breadcrumb-item"><a href="{{ path('app_home') }}" class="text-decoration-none text-dark">Accueil</a></li>
  55.                             <li class="breadcrumb-item active" aria-current="page">Blog</li>
  56.                         </ol>
  57.                     </nav>
  58.                 </div>
  59.             </div>
  60.         </div>
  61.     </div>
  62.     {% for message in app.flashes('success') %}
  63.         <div class="alert alert-success alert-dismissible fade show text-center mt-4 mb-5" role="alert">
  64.             {{ message }}
  65.             <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
  66.         </div>
  67.     {% endfor %}
  68.     {% for message in app.flashes('email_not_exists') %}
  69.         <div class="alert alert-danger alert-dismissible fade show text-center mt-4 mb-5" role="alert">
  70.             {{ message }}
  71.             <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
  72.         </div>
  73.     {% endfor %}
  74.     {% for message in app.flashes('unsubscribe') %}
  75.         <div class="alert alert-success alert-dismissible fade show text-center mt-4 mb-5" role="alert">
  76.             {{ message }}
  77.             <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
  78.         </div>
  79.     {% endfor %}
  80.     <h1 class="text-center mb-2 color1 fw-700 text-uppercase" data-aos="fade-down" data-aos-duration="2000">Blog</h1>
  81.     <div class="row row-cols-1 row-cols-md-3 g-4 mt-3">
  82.         {% for article in articles %}
  83.             <div class="col blog-cards">
  84.                 <div class="card h-100">
  85.                     <img src="{{ asset('assets/img/articles/' ~ article.image ) }}" class="card-img-top img-fluid shadow" data-aos="flip-right" data-aos-duration="2000" alt="{{ article.title }}">
  86.                     <div class="card-body">
  87.                         <h5 class="card-title">
  88.                             <a href="{{ path('app_blog_article_show', {'slug': article.slug}) }}" class="text-decoration-none color1 text-uppercase fw-bold">
  89.                                 {{ article.title }}
  90.                             </a>
  91.                         </h5>
  92.                         <p class="text-xsmall color1">
  93.                             Publié le {{ article.createdAt|date('d-m-Y') }}
  94.                             {% if article.updatedAt != null %}
  95.                                 | Mis à jour le {{ article.updatedAt|date('d-m-Y') }}
  96.                             {% endif %}
  97.                             <br>Catégorie :
  98.                             <a href="{{ path('app_blog_category_show', {'slug': article.category.slug}) }}" class="text-decoration-none color2">
  99.                                 {{ article.category.title }}
  100.                             </a>
  101.                         </p>
  102.                         <p class="card-text">{{ article.content|replace({'<div>': '', '</div>': '', '<p>': '', '</p>': '',})|slice(0,200)|raw }}...</p>
  103.                     </div>
  104.                     <div class="card-footer">
  105.                         <a href="{{ path('app_blog_article_show', {'slug': article.slug}) }}" class="text-decoration-none">
  106.                             <span class="button-difference text-uppercase">Lire la suite</span>
  107.                         </a>
  108.                     </div>
  109.                 </div>
  110.             </div>
  111.         {% endfor %}
  112.     </div>
  113.     <div class="row mt-5">
  114.         <div class="col navigation d-flex justify-content-center">
  115.             {{ knp_pagination_render(articles) }}
  116.         </div>
  117.     </div>
  118. </section>
  119. {% endblock %}