templates/blog/post_show.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block body_id 'blog_post_show' %}
  3. {% block main %}
  4.     <h1>{{ post.title }}</h1>
  5.     <p class="post-metadata">
  6.         <span class="metadata"><i class="fa fa-calendar"></i> {{ post.publishedAt|format_datetime('long', 'medium', '', 'UTC') }}</span>
  7.         <span class="metadata"><i class="fa fa-user"></i> {{ post.author.fullName }}</span>
  8.     </p>
  9.     {{ post.content|markdown_to_html|sanitize_html }}
  10. {% endblock %}
  11. {% block sidebar %}
  12.     {% if is_granted('edit', post) %}
  13.         <div class="section">
  14.             <a class="btn btn-lg btn-block btn-success" href="{{ path('admin_post_edit', {id: post.id}) }}">
  15.                 <i class="fa fa-edit" aria-hidden="true"></i> {{ 'action.edit_post'|trans }}
  16.             </a>
  17.         </div>
  18.     {% endif %}
  19.     {# the parent() function includes the contents defined by the parent template
  20.       ('base.html.twig') for this block ('sidebar'). This is a very convenient way
  21.       to share common contents in different templates #}
  22.     {{ parent() }}
  23. {% endblock %}