{# src//WebBundle/Resources/views/blog.html.twig #}
{% extends 'webbase.html.twig' %}
{% block blogClass 'active' %}
{% if tag != null %}
{% set title = pageEntity.metaTitle~' - '~tag.name %}
{% elseif monthYear != '/01/' %}
{% set title = pageEntity.metaTitle~' - '~monthYear|date('F Y') %}
{% else %}
{% set title = pageEntity.metaTitle %}
{% endif %}
{% block title title %}
{% set metaDescription = pageEntity.metaDescription|raw %}
{% block metaDescription metaDescription %}
{% block metaKeywords pageEntity.metaKeywords %}
{% block metaAuthor '' %}
{% set googlePlusLink = '' %}
{% block googleAuthor googlePlusLink %}
{% block body -%}
<section id="blog">
<div class="row">
<img data-src="holder.js/2400x400/auto/vine/text:Blog" class="img-responsive" alt="Blog">
</div>
<div class="container">
<div class="row">
<div class="col-md-8">
{% if monthYear != '/01/' %}
<h1>{{ pageEntity.title }} - {{ monthYear|date('F Y') }}</h1>
<p>
There {% if nbResults == 1 %} is {{ nbResults }} blog{% else %} are {{ nbResults }} blogs{% endif %}
in {{ monthYear|date('F Y') }}. You can see all of our latest blogs <a
href="{{ path('blog') }}">here</a>.
</p>
{% elseif tag != null %}
<h1>{{ pageEntity.title }} - {{ tag.name }}</h1>
{% set contactActionNoticeError = app.session.flashbag.get('error') %}
{% if (contactActionNoticeError is not empty) %}
{% for flashMessage in contactActionNoticeError %}
<div class="flash-notice alert alert-error">
<button type="button" class="close" data-dismiss="alert">×</button>
{{ flashMessage }}
</div>
{% endfor %}
{% endif %}
<p>
There {% if nbResults == 1 %} is {{ nbResults }} blog{% else %} are {{ nbResults }} blogs{% endif %}
tagged '{{ tag.name }}'. You can see all of our latest blogs <a
href="{{ path('blog') }}">here</a>.
</p>
{% else %}
<h1>{{ pageEntity.title }}</h1>
{% set contactActionNoticeError = app.session.flashbag.get('error') %}
{% if (contactActionNoticeError is not empty) %}
{% for flashMessage in contactActionNoticeError %}
<div class="flash-notice alert alert-error">
<button type="button" class="close" data-dismiss="alert">×</button>
{{ flashMessage }}
</div>
{% endfor %}
{% else %}
<p>{{ pageEntity.content | raw }}</p>
{% endif %}
{% endif %}
<div class="row">
{% if nbResults >= 9 %}
<div class="pagerfanta pull-right">
{{ pagerfanta(articles, 'twitter_bootstrap', {'proximity': 1, 'dots_message':' ', 'next_message':'<i class="fa fa-chevron-right"></i>' ,'prev_message': '<i class="fa fa-chevron-left"></i>'}) }}
</div>
{% endif %} <br/>
</div>
{% for article in articles %}
<h2>
<a href="{{ path('Blog_Article', {'slug': article.slug ,'date': article.datePublished|date("Ymd")}) }}">{{ article.title }}</a>
</h2>
<p class="text-muted">
by {{ article.createdBy.person.firstName }} {{ article.createdBy.person.lastName }}
- {{ article.datePublished | date("jS F Y") }}</p>
{% for tag in article.tags %}
<a href="{{ path("blog_tag", {"tag": tag.slug}) }}"
class="label label-default">{{ tag.name }}</a>
{% endfor %}
<p>
{{ article.content | striptags | u.truncate (400) | raw }}
<a href="{{ path('Blog_Article', {'slug': article.slug ,'date': article.datePublished|date("Ymd")}) }}"
class="pull-right">Read More</a>
</p>
<hr/>
{% endfor %}
</div>
<div class="col-md-4">
{% include "web/Default/features.html.twig" with {"feature": pageEntity.feature1 } %}
</div>
</div>
<div class="row">
{% if nbResults >= 9 %}
<div class="pagerfanta pull-right">
{{ pagerfanta(articles, 'twitter_bootstrap', {'proximity': 1, 'dots_message':' ', 'next_message':'<i class="fa fa-chevron-right"></i>' ,'prev_message': '<i class="fa fa-chevron-left"></i>'}) }}
</div>
{% endif %} <br/>
</div>
</div>
</section>
{% endblock %}
{% block javascripts %}
{{ parent() }}
{% endblock %}