templates/blog/post.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block opengraph %}
  3.     <meta property="og:title" content="{{ post.title }}" />
  4.     <meta property="og:url" content="{{ app.request.getSchemeAndHttpHost() ~ path('show_post', {'slug': post.slug, 'year': post.date.format('Y'), 'month': post.date.format('m'), 'day': post.date.format('d') }) }}" />
  5.     <meta property="og:image" content="{{ app.request.getSchemeAndHttpHost() ~ '/assets/blog/' ~ post.imageName }}" />
  6.     <meta property="og:type" content="article" />
  7.     <meta property="og:description" content="{{ post.content | striptags | truncate(100, true) | raw }}" />
  8.     <meta property="og:locale" content="{{ app.request.locale == 'es' ? 'es_ES' : 'en_GB' }}" />
  9.     <meta property="fb:app_id" content="173823370450020" />
  10. {% endblock opengraph %}
  11. {% block header %}
  12. <!-- Header -->
  13. <header class="header text-white pt-8 mt-10 h-250" style="background-image: url(/img/bg/fondo-hojas.png);" data-overlay="8">
  14.     <div class="container text-center">
  15.         <div class="row">
  16.             {#<div class="col-md-8 mx-auto">#}
  17.             {#    <h1>Blog</h1>#}
  18.             {#</div>#}
  19.         </div>
  20.     </div>
  21. </header><!-- /.header -->
  22. {% endblock %}
  23. {% block body %}
  24.       <div class="section">
  25.         <img style="position: absolute; height: 20%; top: 0;" src="/img/bg/degradado.png" alt="Degradado decorativo">
  26.         <div class="container">
  27.           <div class="text-center mt-8">
  28.             <h2 style="font-weight: 600; color: #4A4A4A; text-align: center;">{{ post.title }}</h2>
  29.             <p>{{ post.date | localizeddate('full', 'none', app.request.locale ) }} en {{ categoriesHtml | raw }} por {{ post.author }}</p>
  30.           </div>
  31.           <div class="text-center my-8">
  32.             <img class="rounded-md" style="max-width: 500px;" src="{{ asset('/assets/blog/'~ post.imageName) | imagine_filter('mode_image') }}" alt="Imagen relacionada con la publicación">
  33.           </div>
  34.           <div class="row">
  35.             <div class="col-lg-12 mx-auto">
  36.               <p class="lead">{{ post.excerpt }}</p>
  37.               <hr class="w-100px">
  38.                 {{ post.content | raw }}
  39.                 {% if post.galleries | length > 0 %}
  40.                     <div class="media-meta">
  41.                     <strong>Galeria(s):</strong>
  42.                     <ul class="popup-gallery">
  43.                     {% for gallery in post.galleries %}
  44.                         <li>
  45.                         {% set i = 1 %}
  46.                         {% for image in gallery.images %}
  47.                             {% if i == 1 %}
  48.                                 <a href="{{ asset('/assets/gallery/'~image.imageName ) }}" alt="{{ image.altText }}" title="{{ image.title }}">{{ gallery.title }}</a>
  49.                             {% else %}
  50.                                 <a href="{{ asset('/assets/gallery/'~image.imageName ) }}" alt="{{ image.altText }}" title="{{ image.title }}" style="display: none;"></a>
  51.                             {% endif %}
  52.                         {% set i = i + 1 %}
  53.                         {% endfor %}
  54.                         </li>
  55.                     {% endfor %}
  56.                     </ul>
  57.                     </div>
  58.                 {% endif %}
  59.                 {% if post.videos | length > 0 %}
  60.                     <div class="media-meta">
  61.                     <strong>Vídeo(s):</strong>
  62.                     <ul>
  63.                     {% for video in post.videos %}
  64.                         <li><a href="{{ video.videoUrl }}" class="popup-{{ video.provider }}">{{ video.title }}</a></li>
  65.                     {% endfor %}
  66.                     </ul>
  67.                     </div>
  68.                 {% endif %}
  69.             </div>
  70.           </div>
  71.         </div>
  72.         <img style="position: absolute; height: 20%; bottom: 0; right: 0; rotate: 180deg;" src="/img/bg/degradado.png" alt="Degradado decorativo">
  73.       </div>
  74.       {#<div class="section bg-gray">#}
  75.       {#  <div class="container">#}
  76.       {#    <div class="row">#}
  77.       {#      <div class="col-lg-11 mx-auto">#}
  78.       {#          {{ render(controller('App\\Controller\\Blog\\DefaultController::commentsAction', { 'post': post })) }}#}
  79.       {#          {{ form_start(commentForm) }}#}
  80.       {#              <div class="row">#}
  81.       {#                  <div class="form-group col-12 col-md-6">#}
  82.       {#                      {{ form_widget(commentForm.name) }}#}
  83.       {#                      {{ form_errors(commentForm.name) }}#}
  84.       {#                  </div>#}
  85.       {#                  <div class="form-group col-12 col-md-6">#}
  86.       {#                      {{ form_widget(commentForm.email) }}#}
  87.       {#                      {{ form_errors(commentForm.email) }}#}
  88.       {#                  </div>#}
  89.       {#              </div>#}
  90.       {#              <div class="form-group">#}
  91.       {#                  {{ form_widget(commentForm.message) }}#}
  92.       {#                  {{ form_errors(commentForm.message) }}#}
  93.       {#              </div>#}
  94.       {#              {{ form_widget(commentForm.submit, {'attr': {'class': 'btn-primary btn-block'}}) }}#}
  95.       {#          {{ form_end(commentForm) }}#}
  96.                 {# <form action="#" method="POST">#}
  97.       {#          <div class="row">#}
  98.       {#            <div class="form-group col-12 col-md-6">#}
  99.       {#              <input class="form-control" type="text" placeholder="Name">#}
  100.       {#            </div>#}
  101.       {#            <div class="form-group col-12 col-md-6">#}
  102.       {#              <input class="form-control" type="text" placeholder="Email">#}
  103.       {#            </div>#}
  104.       {#          </div>#}
  105.       {#          <div class="form-group">#}
  106.       {#            <textarea class="form-control" placeholder="Comment" rows="4"></textarea>#}
  107.       {#          </div>#}
  108.       {#          <button class="btn btn-primary btn-block" type="submit">Submit your comment</button>#}
  109.       {#        </form> #}
  110.       {#      </div>#}
  111.       {#    </div>#}
  112.       {#  </div>#}
  113.       {#</div>#}
  114.     {# <div id="blog_post" style="margin-top: 140px;">
  115.         <div class="container">
  116.             <div class="section_header" style="padding-bottom: 30px;">
  117.                 <h3>Blog</h3>
  118.             </div>
  119.             <div class="row">
  120.                 <div class="col-sm-8">
  121.                     <img class="post_pic img-responsive" src="{{ asset('/assets/blog/'~ post.imageName) | imagine_filter('mode_image') }}" />
  122.                     <div class="post_content">
  123.                         <h2>{{ post.title }}</h2>
  124.                         <span class="date">{{ post.date | localizeddate('full', 'none', app.request.locale ) }}</span>
  125.                         <div class="meta"><strong>Publicado en:</strong> {{ categoriesHtml | raw }}</div>
  126.                         <p><strong>{{ post.excerpt }}</strong></p>
  127.                         {{ post.content | raw }}
  128.                         <div class="author_box">
  129.                             <div class="author">{{ post.author }}</div>
  130.                         </div>
  131.                         {% if post.galleries | length > 0 %}
  132.                             <div class="media-meta">
  133.                             <strong>Galeria(s):</strong>
  134.                             <ul class="popup-gallery">
  135.                             {% for gallery in post.galleries %}
  136.                                 <li>
  137.                                 {% set i = 1 %}
  138.                                 {% for image in gallery.images %}
  139.                                     {% if i == 1 %}
  140.                                         <a href="{{ asset('/assets/gallery/'~image.imageName ) }}" alt="{{ image.altText }}" title="{{ image.title }}">{{ gallery.title }}</a>
  141.                                     {% else %}
  142.                                         <a href="{{ asset('/assets/gallery/'~image.imageName ) }}" alt="{{ image.altText }}" title="{{ image.title }}" style="display: none;"></a>
  143.                                     {% endif %}
  144.                                 {% set i = i + 1 %}
  145.                                 {% endfor %}
  146.                                 </li>
  147.                             {% endfor %}
  148.                             </ul>
  149.                             </div>
  150.                         {% endif %}
  151.                         {% if post.videos | length > 0 %}
  152.                             <div class="media-meta">
  153.                             <strong>Vídeo(s):</strong>
  154.                             <ul>
  155.                             {% for video in post.videos %}
  156.                                 <li><a href="{{ video.videoUrl }}" class="popup-{{ video.provider }}">{{ video.title }}</a></li>
  157.                             {% endfor %}
  158.                             </ul>
  159.                             </div>
  160.                         {% endif %}
  161.                         <div class="share-meta"><a href="javascript:void(0);" data-network="twitter" class="st-custom-button twitter" data-url="{{ app.request.uri }}" data-title="{{ post.title }} via @TenerifeBlueTra">Twitter</a><a href="javascript:void(0);" data-network="facebook" class="st-custom-button facebook" data-title="Entra en el Equipo Cajamar Tenerife Bluetrail 2017">Facebook</a><a href="javascript:void(0);" data-network="linkedin" class="st-custom-button linkedin" data-title="Entra en el Equipo Cajamar Tenerife Bluetrail 2017">LinkedIn</a><a href="javascript:void(0);" data-network="googleplus" class="st-custom-button googleplus" data-title="Entra en el Equipo Cajamar Tenerife Bluetrail 2017">Google +</a></div>
  162.                     </div>
  163.                     {{ render(controller('App\\Controller\\Blog\\DefaultController::commentsAction', { 'post': post })) }}
  164.                     <div class="new_comment">
  165.                         <h4>Añadir Comentario</h4>
  166.                         {{ form_start(commentForm) }}
  167.                             <div class="row">
  168.                                 <div class="col-sm-6">
  169.                                     {{ form_widget(commentForm.name) }}
  170.                                     {{ form_errors(commentForm.name) }}
  171.                                 </div>
  172.                                 <div class="col-sm-6">
  173.                                     {{ form_widget(commentForm.email) }}
  174.                                     {{ form_errors(commentForm.email) }}
  175.                                 </div>
  176.                             </div>
  177.                             <div class="row">
  178.                                 <div class="col-sm-12">
  179.                                     {{ form_widget(commentForm.message) }}
  180.                                     {{ form_errors(commentForm.message) }}
  181.                                 </div>
  182.                             </div>
  183.                             <div class="row">
  184.                                 <div class="col-sm-12">
  185.                                     {{ form_widget(commentForm.submit) }}
  186.                                 </div>
  187.                             </div>
  188.                         {{ form_end(commentForm) }}
  189.                     </div>
  190.                 </div>
  191.                 <!-- SideBar -->
  192.                 {% include 'blog/sidebar.html.twig' %}
  193.             </div>
  194.         </div>
  195.     </div> #}
  196. {% endblock body %}
  197. {% block background %} style="background: url('{{ asset('/assets/mode/'~mode.headerImageName) }}');"{% endblock background %}