{# src//WebBundle/Resources/views/blog.html.twig #}
{% extends 'webbase.html.twig' %}
{% block blogClass 'active' %}
{% set title = article.title %}
{% block title title %}
{% set metaDescription = article.content|striptags|u.truncate(150) %}
{% block metaDescription metaDescription %}
{% block metaKeywords pageEntity.metaKeywords %}
{% block metaAuthor '' %}
{% set googlePlusLink = article.createdBy.person.googlePlusLink %}
{% block googleAuthor googlePlusLink %}
{% block body -%}
<section id="blog">
<div class="row">
{% if article is not null and article.imageName %}
<div class="hero-image"
style='background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("/uploads{{ asset(article.imageName)|escape }}");'>
<div class="hero-text">
</div>
</div>
{% else %}
<img data-src="holder.js/2400x400/auto/vine/text:Blog" class="img-responsive" alt="Blog">
{% endif %}
</div>
<div class="container">
<div class="row">
<div class="col-md-8">
<div>
<h1>{{ article.title }}</h1>
<div class="pull-right share-bar">
{% set tagArray = [] %}
{% for tag in article.tags %}
{% set tagArray = tagArray|merge([tag.name]) %}
{% endfor %}
{% if article.createdBy.person.twitterName != null %}
<a href="https://twitter.com/share" class="twitter-share-button"
data-related="{{ article.createdBy.person.twitterName }}"
data-text="{{ article.title|hashTweet(tagArray) }}" data-lang="en"
data-count="none" target="_blank">Tweet</a>
{% endif %}
<!-- Google +1 tag. -->
<div class="g-plusone" data-size="medium" data-annotation="none"
data-width="300"></div>
<!-- Twitter tag. -->
<script>!function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0],
p = /^http:/.test(d.location) ? 'http' : 'https';
if (!d.getElementById(id)) {
js = d.createElement(s);
js.id = id;
js.src = p + '://platform.twitter.com/widgets.js';
fjs.parentNode.insertBefore(js, fjs);
}
}(document, 'script', 'twitter-wjs');</script>
</div>
<p class="text-muted">
by {{ article.createdBy.person.firstName }} {{ article.createdBy.person.lastName }}
- {{ article.datePublished | date("jS F Y") }}
</p>
</div>
<div>
<p class="clearfix">
{% for tag in article.tags %}
<a href="{{ path("blog_tag", {"tag": tag.slug}) }}"
class="label label-default">{{ tag.name }}</a>
{% endfor %}
<a href="{{ url }}" class="btn btn-primary btn-xs pull-right"> Back</a>
</p>
</div>
<div>
<p>{{ article.content|geshi_pre|raw|nl2br }}</p>
</div>
</div>
<div class="col-md-4">
{% include "web/Default/features.html.twig" with {"feature": pageEntity.feature1 } %}
</div>
</div>
<div class="row">
<div class="col-md-8">
<div class="pull-right">
<p>Comments: Send us an <a
href="mailto:ben.stinton@alphawerk.co.uk?subject=Blog-{{ article.title }}">Email</a>
</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-8">
<div class="pull-right share-bar">
{% if article.createdBy.person.twitterName != null %}
<a href="https://twitter.com/share" class="twitter-share-button"
data-related="{{ article.createdBy.person.twitterName }}"
data-text="{{ article.title|hashTweet(tagArray) }}" data-lang="en"
data-size="tall" data-count="none" target="_blank">Tweet</a>
{% endif %}
<!-- LinkedIn tag. -->
<script type="IN/Share"></script>
<!-- Google +1 tag. -->
<div class="g-plusone" data-size="medium" data-annotation="none"
data-width="300"></div>
<!-- Twitter tag. -->
<script>!function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0],
p = /^http:/.test(d.location) ? 'http' : 'https';
if (!d.getElementById(id)) {
js = d.createElement(s);
js.id = id;
js.src = p + '://platform.twitter.com/widgets.js';
fjs.parentNode.insertBefore(js, fjs);
}
}(document, 'script', 'twitter-wjs');</script>
</div>
</div>
</div>
</div>
</section>
{% endblock %}
{% block javascripts %}
{{ parent() }}
<script src="{{ asset('js/prism.js') }}"></script>
{% endblock %}