You are here

post.html.twig in Open Social 8.4

post.html.twig Default theme implementation to present Post data.

This template is used when viewing Post pages.

Available variables:

  • content: A list of content items. Use 'content' to print all content, or
  • attributes: HTML attributes for the container element.

File

themes/socialbase/templates/post/post.html.twig
View source
  1. {#
  2. /**
  3. * @file post.html.twig
  4. * Default theme implementation to present Post data.
  5. *
  6. * This template is used when viewing Post pages.
  7. *
  8. *
  9. * Available variables:
  10. * - content: A list of content items. Use 'content' to print all content, or
  11. * - attributes: HTML attributes for the container element.
  12. *
  13. * @see template_preprocess_post()
  14. *
  15. * @ingroup themeable
  16. */
  17. #}
  18. {{ attach_library('socialbase/comment') }}
  19. {{ attach_library('socialbase/page-node')}}
  20. <div class="card">
  21. <div class="card__block">
  22. <div class="media-wrapper">
  23. <div class="media">
  24. <div class="media-left avatar">
  25. {% if author_picture %}
  26. {{ author_picture }}
  27. {% endif %}
  28. </div>
  29. <div class="media-body">
  30. <div class="media-heading text-m">
  31. {% if content.user_id %}
  32. {{ content.user_id }}
  33. {% endif %}
  34. <div class="post-date">
  35. {{ date }}
  36. {% if visibility_icon and visibility_label %}
  37. <svg class="margin-left-s icon-visibility">
  38. <use xlink:href="#icon-{{ visibility_icon }}"></use>
  39. </svg>
  40. <strong>{{ visibility_label }}</strong>
  41. {% endif %}
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. {% if published %}
  47. {{ content.links }}
  48. {% endif %}
  49. </div>
  50. {% if not published %}
  51. <div class="node--unpublished__label">{% trans %} unpublished {% endtrans %}</div>
  52. {% endif %}
  53. <div class="margin-top-s iframe-container">
  54. {{ content|without('links', 'field_post_comments', 'like_and_dislike', 'field_post_image', 'user_id') }}
  55. {% if content.field_post_image|render %}
  56. <p>{{ content.field_post_image }}</p>
  57. {% endif %}
  58. <div class="clearfix"></div>
  59. {{ content.like_and_dislike }}
  60. </div>
  61. {% if logged_in %}
  62. <div class="card__nested-section">
  63. {{ content.field_post_comments }}
  64. </div>
  65. {% endif %}
  66. </div>
  67. </div>