templates/front/blog/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}{{ 'app.menu.blog'|trans }}{% endblock %}
  3. {% block body %}
  4.     <!-- start page-title -->
  5.     <section class="page-title">
  6.         <div class="container">
  7.             <div class="row">
  8.                 <div class="col col-xs-12">
  9.                     <h2>{{ 'app.menu.blog'|trans }}</h2>
  10.                     {# <p>Gregor then turned to look out the window at the weather</p> #}
  11.                 </div>
  12.             </div>
  13.             <!-- end row -->
  14.         </div>
  15.         <!-- end container -->
  16.     </section>
  17.     <!-- end page-title -->
  18.     <!-- start blog-pg-section -->
  19.     <section class="blog-pg-section section-padding">
  20.         <div class="container">
  21.             <div class="row">
  22.                 <div class="col col-md-8">
  23.                     {% for post in posts %}
  24.                         {% set link = post.link is not null ? post.link : path('app_blog_show', { id: post.id }) %}
  25.                         {% set link = post.pdf is not null ? '/' ~ blog_files_directory ~ '/' ~ post.pdf : link %}
  26.                         {% set _target = post.link is not null or post.pdf is not null ? '_blank' : '_self' %}
  27.                         <div class="blog-content">
  28.                             <div class="post format-standard-image">
  29.                                 <div class="entry-media">
  30.                                     <img src="{{ asset( blog_images_directory ~ '/' ~ post.image ) }}" alt>
  31.                                 </div>
  32.                                 <div class="entry-details">
  33.                                     <div class="cat">{{ app.request.locale == 'fr' ? post.category : post.categoryEng }}</div>
  34.                                     <h3>
  35.                                         <a href="{{ link }}" target="{{ _target }}">{{post.title}}</a>
  36.                                     </h3>
  37.                                     <p>{{ post.description|slice(0, 50)|raw }}...
  38.                                     </p>
  39.                                     <a href="{{ link }}" target="{{ _target }}" class="read-more">{{ 'app.blog.readMore'|trans }}</a>
  40.                                 </div>
  41.                                 <div class="entry-meta">
  42.                                     <span>{{ 'app.blog.by'|trans }}:
  43.                                         <a href="{{ link }}" target="{{ _target }}">{{post.author}}</a>
  44.                                     </span>
  45.                                     <span>Date:
  46.                                         {{post.date|date("d/m/Y")}}
  47.                                     </span>
  48.                                 </div>
  49.                             </div>
  50.                         </div>
  51.                         {% else %}
  52.                     {% endfor %}
  53.                     <!--blog pagination area start-->
  54.                     {{ knp_pagination_render(posts) }}
  55.                     <!--blog pagination area end-->
  56.                 </div>
  57.                 <div class="col col-md-4">
  58.                     <div class="blog-sidebar">
  59.                         <div class="widget search-widget">
  60.                             <h3>{{ 'app.blog.search'|trans }}</h3>
  61.                             <form action="{{ path('app_blog_index') }}" method="GET">
  62.                                 <div>
  63.                                     <input type="text" name="keyword" class="form-control" placeholder="{{ 'app.blog.keyword'|trans }}.." value="{{ keyword is defined ? keyword : '' }}">
  64.                                     <button type="submit"><i class="ti-search"></i></button>
  65.                                 </div>
  66.                             </form>
  67.                         </div>
  68.                         <div class="widget category-widget">
  69.                             <h3>{{ 'app.blog.categories'|trans }}</h3>
  70.                             <ul>
  71.                                 <li>
  72.                                     <a href="{{ path('app_blog_index') }}">
  73.                                         {{ 'app.blog.all'|trans }}<span>({{ count }})</span>
  74.                                     </a>
  75.                                 </li>
  76.                                 {% for category in categories %}
  77.                                     <li>
  78.                                         <a href="{{ path('app_blog_category', { id: category.id }) }}">
  79.                                             {{ app.request.locale == 'fr' ? category.name : category.nameEng }}<span>({{ category.posts|length }})</span>
  80.                                         </a>
  81.                                     </li>
  82.                                 {% endfor %}
  83.                             </ul>
  84.                         </div>
  85.                         <div class="widget recent-post-widget">
  86.                             <h3>{{ 'app.blog.recentPost'|trans }}</h3>
  87.                             <div class="posts">
  88.                                 {% for post in recent_post %}
  89.                                     <div class="post">
  90.                                         <div class="img-holder">
  91.                                             <img src="{{ asset( blog_images_directory ~ '/' ~ post.image.name ) }}" alt>
  92.                                         </div>
  93.                                         <div class="details">
  94.                                             <h4>
  95.                                                 {% set link = post.link is not null ? post.link : path('app_blog_show', { id: post.id }) %}
  96.                                                 {% set link = post.fileDetails.name is not null ? '/' ~ blog_files_directory ~ '/' ~ post.fileDetails.name : link %}
  97.                                                 {% set _target = post.link is not null or post.fileDetails.name is not null ? '_blank' : '_self' %}
  98.                                                 <a href="{{ link }}" target="{{ _target }}">{{post.title}}</a>
  99.                                             </h4>
  100.                                             <span class="date">
  101.                                                 <i class="ti-calendar"></i>
  102.                                                 {{post.date|date("d/m/Y")}}</span>
  103.                                         </div>
  104.                                     </div>
  105.                                 {% endfor %}
  106.                             </div>
  107.                         </div>
  108.                     </div>
  109.                 </div>
  110.             </div>
  111.         </div>
  112.         <!-- end container -->
  113.     </section>
  114.     <!-- end blog-pg-section -->
  115. {% endblock %}