templates/web/Default/blogs.html.twig line 59

Open in your IDE?
  1. {# src//WebBundle/Resources/views/blog.html.twig #}
  2. {% extends 'webbase.html.twig' %}
  3. {% block blogClass 'active' %}
  4. {% if tag != null %}
  5.     {% set title = pageEntity.metaTitle~' - '~tag.name %}
  6. {% elseif monthYear != '/01/' %}
  7.     {% set title = pageEntity.metaTitle~' - '~monthYear|date('F Y') %}
  8. {% else %}
  9.     {% set title = pageEntity.metaTitle %}
  10. {% endif %}
  11. {% block title title %}
  12. {% set metaDescription = pageEntity.metaDescription|raw %}
  13. {% block metaDescription metaDescription %}
  14. {% block metaKeywords pageEntity.metaKeywords %}
  15. {% block metaAuthor '' %}
  16.     {% set googlePlusLink = '' %}
  17. {% block googleAuthor googlePlusLink %}
  18. {% block body -%}
  19.     <section id="blog">
  20.         <div class="row">
  21.             <img data-src="holder.js/2400x400/auto/vine/text:Blog" class="img-responsive" alt="Blog">
  22.         </div>
  23.         <div class="container">
  24.             <div class="row">
  25.                 <div class="col-md-8">
  26.                     {% if monthYear != '/01/' %}
  27.                         <h1>{{ pageEntity.title }} - {{ monthYear|date('F Y') }}</h1>
  28.                         <p>
  29.                             There {% if nbResults == 1 %} is {{ nbResults }} blog{% else %} are {{ nbResults }} blogs{% endif %}
  30.                             in {{ monthYear|date('F Y') }}. You can see all of our latest blogs <a
  31.                                     href="{{ path('blog') }}">here</a>.
  32.                         </p>
  33.                     {% elseif tag != null %}
  34.                         <h1>{{ pageEntity.title }} - {{ tag.name }}</h1>
  35.                         {% set contactActionNoticeError = app.session.flashbag.get('error') %}
  36.                         {% if (contactActionNoticeError is not empty) %}
  37.                             {% for flashMessage in contactActionNoticeError %}
  38.                                 <div class="flash-notice alert alert-error">
  39.                                     <button type="button" class="close" data-dismiss="alert">&times;</button>
  40.                                     {{ flashMessage }}
  41.                                 </div>
  42.                             {% endfor %}
  43.                         {% endif %}
  44.                         <p>
  45.                             There {% if nbResults == 1 %} is {{ nbResults }} blog{% else %} are {{ nbResults }} blogs{% endif %}
  46.                             tagged '{{ tag.name }}'. You can see all of our latest blogs <a
  47.                                     href="{{ path('blog') }}">here</a>.
  48.                         </p>
  49.                     {% else %}
  50.                         <h1>{{ pageEntity.title }}</h1>
  51.                         {% set contactActionNoticeError = app.session.flashbag.get('error') %}
  52.                         {% if (contactActionNoticeError is not empty) %}
  53.                             {% for flashMessage in contactActionNoticeError %}
  54.                                 <div class="flash-notice alert alert-error">
  55.                                     <button type="button" class="close" data-dismiss="alert">&times;</button>
  56.                                     {{ flashMessage }}
  57.                                 </div>
  58.                             {% endfor %}
  59.                         {% else %}
  60.                             <p>{{ pageEntity.content | raw }}</p>
  61.                         {% endif %}
  62.                     {% endif %}
  63.                     <div class="row">
  64.                         {% if nbResults >= 9 %}
  65.                             <div class="pagerfanta pull-right">
  66.                                 {{ pagerfanta(articles, 'twitter_bootstrap', {'proximity': 1, 'dots_message':' &nbsp;', 'next_message':'<i class="fa fa-chevron-right"></i>' ,'prev_message': '<i class="fa fa-chevron-left"></i>'}) }}
  67.                             </div>
  68.                         {% endif %} <br/>
  69.                     </div>
  70.                     {% for article in articles %}
  71.                         <h2>
  72.                             <a href="{{ path('Blog_Article', {'slug': article.slug ,'date': article.datePublished|date("Ymd")}) }}">{{ article.title }}</a>
  73.                         </h2>
  74.                         <p class="text-muted">
  75.                             by {{ article.createdBy.person.firstName }} {{ article.createdBy.person.lastName }}
  76.                             - {{ article.datePublished | date("jS F Y") }}</p>
  77.                         {% for tag in article.tags %}
  78.                             <a href="{{ path("blog_tag", {"tag": tag.slug}) }}"
  79.                                class="label label-default">{{ tag.name }}</a>
  80.                         {% endfor %}
  81.                         <p>
  82.                             {{ article.content | striptags | u.truncate (400) | raw }}
  83.                             <a href="{{ path('Blog_Article', {'slug': article.slug ,'date': article.datePublished|date("Ymd")}) }}"
  84.                                class="pull-right">Read More</a>
  85.                         </p>
  86.                         <hr/>
  87.                     {% endfor %}
  88.                 </div>
  89.                 <div class="col-md-4">
  90.                     {% include "web/Default/features.html.twig" with {"feature": pageEntity.feature1 } %}
  91.                 </div>
  92.             </div>
  93.             <div class="row">
  94.                 {% if nbResults >= 9 %}
  95.                     <div class="pagerfanta pull-right">
  96.                         {{ pagerfanta(articles, 'twitter_bootstrap', {'proximity': 1, 'dots_message':' &nbsp;', 'next_message':'<i class="fa fa-chevron-right"></i>' ,'prev_message': '<i class="fa fa-chevron-left"></i>'}) }}
  97.                     </div>
  98.                 {% endif %} <br/>
  99.             </div>
  100.         </div>
  101.     </section>
  102. {% endblock %}
  103. {% block javascripts %}
  104.     {{ parent() }}
  105. {% endblock %}