You are here

post.html.twig in Open Social 8

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. <div class="card">
  20. <div class="card__block">
  21. <div class="media-wrapper">
  22. <div class="media">
  23. <div class="media-left avatar">
  24. {% if author_picture %}
  25. {{ author_picture }}
  26. {% endif %}
  27. </div>
  28. <div class="media-body">
  29. <div class="media-heading text-m">
  30. {% if content.user_id %}
  31. {{ content.user_id }}
  32. {% endif %}
  33. <div class="post-date">{{ date }}</div>
  34. </div>
  35. </div>
  36. </div>
  37. {{ content.links }}
  38. </div>
  39. <div class="margin-top-s iframe-container">
  40. {{ content|without('links', 'field_post_comments', 'like_and_dislike', 'field_post_image', 'user_id') }}
  41. {% if content.field_post_image|render %}
  42. <p>{{ content.field_post_image }}</p>
  43. {% endif %}
  44. <div class="clearfix"></div>
  45. {{ content.like_and_dislike }}
  46. </div>
  47. {% if logged_in %}
  48. <div class="card__nested-section">
  49. {{ content.field_post_comments }}
  50. </div>
  51. {% endif %}
  52. </div>
  53. </div>