templates/web/Default/blog.html.twig line 1

Open in your IDE?
  1. {# src//WebBundle/Resources/views/blog.html.twig #}
  2. {% extends 'webbase.html.twig' %}
  3. {% block blogClass 'active' %}
  4.     {% set title = article.title %}
  5. {% block title title %}
  6. {% set metaDescription = article.content|striptags|u.truncate(150) %}
  7. {% block metaDescription metaDescription %}
  8. {% block metaKeywords pageEntity.metaKeywords %}
  9. {% block metaAuthor '' %}
  10.     {% set googlePlusLink = article.createdBy.person.googlePlusLink %}
  11. {% block googleAuthor googlePlusLink %}
  12. {% block body -%}
  13.     <section id="blog">
  14.         <div class="row">
  15.             {% if article is not null and article.imageName %}
  16.                 <div class="hero-image"
  17.                      style='background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("/uploads{{ asset(article.imageName)|escape }}");'>
  18.                     <div class="hero-text">
  19.                     </div>
  20.                 </div>
  21.             {% else %}
  22.                 <img data-src="holder.js/2400x400/auto/vine/text:Blog" class="img-responsive" alt="Blog">
  23.             {% endif %}
  24.         </div>
  25.         <div class="container">
  26.             <div class="row">
  27.                 <div class="col-md-8">
  28.                     <div>
  29.                         <h1>{{ article.title }}</h1>
  30.                         <div class="pull-right share-bar">
  31.                             {% set tagArray = [] %}
  32.                             {% for tag in article.tags %}
  33.                                 {% set tagArray = tagArray|merge([tag.name]) %}
  34.                             {% endfor %}
  35.                             {% if article.createdBy.person.twitterName != null %}
  36.                                 <a href="https://twitter.com/share" class="twitter-share-button"
  37.                                    data-related="{{ article.createdBy.person.twitterName }}"
  38.                                    data-text="{{ article.title|hashTweet(tagArray) }}" data-lang="en"
  39.                                    data-count="none" target="_blank">Tweet</a>
  40.                             {% endif %}
  41.                             <!-- Google +1 tag. -->
  42.                             <div class="g-plusone" data-size="medium" data-annotation="none"
  43.                                  data-width="300"></div>
  44.                             <!-- Twitter tag. -->
  45.                             <script>!function (d, s, id) {
  46.                                     var js, fjs = d.getElementsByTagName(s)[0],
  47.                                         p = /^http:/.test(d.location) ? 'http' : 'https';
  48.                                     if (!d.getElementById(id)) {
  49.                                         js = d.createElement(s);
  50.                                         js.id = id;
  51.                                         js.src = p + '://platform.twitter.com/widgets.js';
  52.                                         fjs.parentNode.insertBefore(js, fjs);
  53.                                     }
  54.                                 }(document, 'script', 'twitter-wjs');</script>
  55.                         </div>
  56.                         <p class="text-muted">
  57.                             by {{ article.createdBy.person.firstName }} {{ article.createdBy.person.lastName }}
  58.                             - {{ article.datePublished | date("jS F Y") }}
  59.                         </p>
  60.                     </div>
  61.                     <div>
  62.                         <p class="clearfix">
  63.                             {% for tag in article.tags %}
  64.                                 <a href="{{ path("blog_tag", {"tag": tag.slug}) }}"
  65.                                    class="label label-default">{{ tag.name }}</a>
  66.                             {% endfor %}
  67.                             <a href="{{ url }}" class="btn btn-primary btn-xs pull-right"> Back</a>
  68.                         </p>
  69.                     </div>
  70.                     <div>
  71.                         <p>{{ article.content|geshi_pre|raw|nl2br }}</p>
  72.                     </div>
  73.                 </div>
  74.                 <div class="col-md-4">
  75.                     {% include "web/Default/features.html.twig" with {"feature": pageEntity.feature1 } %}
  76.                 </div>
  77.             </div>
  78.             <div class="row">
  79.                 <div class="col-md-8">
  80.                     <div class="pull-right">
  81.                         <p>Comments: Send us an <a
  82.                                     href="mailto:ben.stinton@alphawerk.co.uk?subject=Blog-{{ article.title }}">Email</a>
  83.                         </p>
  84.                     </div>
  85.                 </div>
  86.             </div>
  87.             <div class="row">
  88.                 <div class="col-md-8">
  89.                     <div class="pull-right share-bar">
  90.                         {% if article.createdBy.person.twitterName != null %}
  91.                             <a href="https://twitter.com/share" class="twitter-share-button"
  92.                                data-related="{{ article.createdBy.person.twitterName }}"
  93.                                data-text="{{ article.title|hashTweet(tagArray) }}" data-lang="en"
  94.                                data-size="tall" data-count="none" target="_blank">Tweet</a>
  95.                         {% endif %}
  96.                         <!-- LinkedIn tag. -->
  97.                         <script type="IN/Share"></script>
  98.                         <!-- Google +1 tag. -->
  99.                         <div class="g-plusone" data-size="medium" data-annotation="none"
  100.                              data-width="300"></div>
  101.                         <!-- Twitter tag. -->
  102.                         <script>!function (d, s, id) {
  103.                                 var js, fjs = d.getElementsByTagName(s)[0],
  104.                                     p = /^http:/.test(d.location) ? 'http' : 'https';
  105.                                 if (!d.getElementById(id)) {
  106.                                     js = d.createElement(s);
  107.                                     js.id = id;
  108.                                     js.src = p + '://platform.twitter.com/widgets.js';
  109.                                     fjs.parentNode.insertBefore(js, fjs);
  110.                                 }
  111.                             }(document, 'script', 'twitter-wjs');</script>
  112.                     </div>
  113.                 </div>
  114.             </div>
  115.         </div>
  116.     </section>
  117. {% endblock %}
  118. {% block javascripts %}
  119.     {{ parent() }}
  120.     <script src="{{ asset('js/prism.js') }}"></script>
  121. {% endblock %}