src/UI/WebBundle/Resources/views/Blog/article_show.html.twig line 1

Open in your IDE?
  1. {% extends 'Common/base.html.twig' %}
  2. {% import 'Common/parts/functions.html.twig' as function %}
  3. {% block title %}{{ article.title(locale) }} | {{ parent() }}{% endblock %}
  4. {% block classBody %}blog {{ parent() }}{% endblock %}
  5. {% block description %}{% apply spaceless %}
  6. {% if article.metaDescription(locale) != '' %}
  7. {{ article.metaDescription(locale) }}
  8. {% else %}
  9. {{ parent() }}
  10. {% endif %}
  11. {% endapply %}{% endblock%}
  12. {% block keywords %}{% apply spaceless %}
  13. {% if article.metaKeywords(locale) != '' %}
  14. {{ article.metaKeywords(locale)|join(',') }}
  15. {% else %}
  16. {{ parent() }}
  17. {% endif %}
  18. {% endapply %}{% endblock%}
  19. {% block javascripts %}
  20. {{ parent() }}
  21. {{ encore_entry_script_tags('wt_show_article') }}
  22. {% endblock javascripts %}
  23. {% block contents %}
  24. <div class="container-small" ng-controller="showArticleCtrl">
  25. <nav class="mb-2" aria-label="breadcrumb">
  26. <ol class="breadcrumb mb-0">
  27. <li class="breadcrumb-item"><a href="{{path('web_init')}}">Inicio</a></li>
  28. {% if article.showInBlog %}
  29. <li class="breadcrumb-item"><a href="{{path('web_blog_list_articles')}}">Blog</a></li>
  30. {% endif %}
  31. <li class="breadcrumb-item active" aria-current="page">{{ article.title(locale) }}</li>
  32. </ol>
  33. </nav>
  34. <h2 class="my-2">{{ article.title(locale) }}</h2>
  35. <div class="my-2">
  36. <div class="article_publich_at fs--1">{{ article.publishAt | date('d-m-Y') }} - {{ article.publishAt | ago }}</div>
  37. {% if article.showInBlog %}
  38. <div class="article-categories">
  39. {% for category in article.categories(locale) %}
  40. <a class="text-muted" href="{{ url('web_blog_list_articles_category', { 'categorySlug': category.slug(locale), '_locale': locale} )}}">{{ category.title(locale) }}</a>
  41. {% if not loop.last %} | {%endif%}
  42. {% endfor %}
  43. </div>
  44. {% endif %}
  45. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') and app.user.user.hasRole('ROLE_ADMIN') %}
  46. <a class="text-muted fs--1" href="{{ path('web_admin_blog_edit_article', {'articleId':article.id, 'locale': locale}) }}" >Editar</a>
  47. {% endif %}
  48. </div>
  49. <div class="article-image">
  50. {% if article.headerImageUrl %}
  51. <img class="ui large centered bordered rounded image text-center w-100" src="{{ article.headerImageUrl | imagine_filter('whater_blog_header_image_1200_300') }}">
  52. {% endif %}
  53. </div>
  54. <div class="article-content my-3">
  55. {{ article.content(locale) | raw }}
  56. </div>
  57. <div class="article-keywords">
  58. {% for metaKeyword in article.metaKeywords(locale) %}
  59. <a>#{{ metaKeyword }}</a>
  60. {% endfor %}
  61. </div>
  62. </div>
  63. {% endblock contents %}