post.html.twig in Open Social 8.6
Same filename in this branch
Same filename and directory in other branches
- 8.9 themes/socialbase/templates/post/post.html.twig
- 8 themes/socialbase/templates/post/post.html.twig
- 8.2 themes/socialbase/templates/post/post.html.twig
- 8.3 themes/socialbase/templates/post/post.html.twig
- 8.4 themes/socialbase/templates/post/post.html.twig
- 8.5 themes/socialbase/templates/post/post.html.twig
- 8.7 themes/socialbase/templates/post/post.html.twig
- 8.8 themes/socialbase/templates/post/post.html.twig
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.
See also
File
themes/socialbase/templates/post/post.html.twigView source
- {#
- /**
- * @file 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.
- *
- * @see template_preprocess_post()
- *
- * @ingroup themeable
- */
- #}
-
- {{ attach_library('socialbase/comment') }}
- {{ attach_library('socialbase/post') }}
- {{ attach_library('socialbase/page-node')}}
-
- {%
- set classes = [
- 'media',
- not published ? 'post-unpublished',
- ]
- %}
-
- <div class="card">
- <div class="card__block">
-
- <div class="media-wrapper">
- <div {{ attributes.addClass(classes) }}>
- <div class="media-left avatar">
- {% if author_picture %}
- {{ author_picture }}
- {% endif %}
- </div>
- <div class="media-body">
- <div class="media-heading text-m">
- {% if content.user_id %}
- {{ content.user_id }}
- {% endif %}
- <div class="post-date">
- {{ date }}
- {% if visibility_icon and visibility_label %}
- <svg class="margin-left-s icon-visibility">
- <use xlink:href="#icon-{{ visibility_icon }}"></use>
- </svg>
- <strong>{{ visibility_label }}</strong>
- {% endif %}
- {% if not published %}
- <span class="badge badge-default badge--pill">
- {% trans %} unpublished {% endtrans %}
- </span>
- {% endif %}
- </div>
- </div>
- </div>
- </div>
- {% if content.links %}
- {{ content.links }}
- {% endif %}
- </div>
- <div class="margin-top-s iframe-container">
-
- {{ content|without('links', 'field_post_comments', 'like_and_dislike', 'field_post_image', 'user_id') }}
-
- {% if content.field_post_image|render %}
- <p>{{ content.field_post_image }}</p>
- {% endif %}
-
- <div class="clearfix"></div>
- {{ content.like_and_dislike }}
- </div>
-
-
- {% if logged_in %}
- <div class="card__nested-section">
- {{ content.field_post_comments }}
- </div>
- {% endif %}
-
- </div>
- </div>