You are here

profile--profile--teaser.html.twig in Open Social 8.8

Default theme implementation for profiles.

Available variables:

  • content: Items for the content of the profile. Use 'content' to print them all, or print a subset such as 'content.title'. Use the following code to exclude the printing of a given child element:

  {{ content|without('title') }}
  
  • attributes: HTML attributes for the wrapper.
  • profile: The profile object.
  • url: The profile URL.

File

themes/socialbase/templates/profile/profile--profile--teaser.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. *
  5. * Default theme implementation for profiles.
  6. *
  7. * Available variables:
  8. * - content: Items for the content of the profile.
  9. * Use 'content' to print them all, or print a subset such as
  10. * 'content.title'. Use the following code to exclude the
  11. * printing of a given child element:
  12. * @code
  13. * {{ content|without('title') }}
  14. * @endcode
  15. * - attributes: HTML attributes for the wrapper.
  16. * - profile: The profile object.
  17. * - url: The profile URL.
  18. *
  19. * @ingroup themeable
  20. */
  21. #}
  22. {{ attach_library('socialbase/teaser')}}
  23. <div class="card teaser">
  24. {% block card_image %}
  25. <div class="teaser__image">
  26. <a href="{{ profile_home }}">
  27. {{ content.field_profile_image }}
  28. </a>
  29. </div>
  30. {% endblock %}
  31. {% block card_teaser_type %}
  32. <a href="{{ profile_home }}">
  33. <div class="teaser__teaser-type">
  34. <svg class="teaser__teaser-type-icon">
  35. <use xlink:href="#icon-account_circle"></use>
  36. </svg>
  37. </div>
  38. </a>
  39. {% endblock %}
  40. <div class="teaser__body">
  41. <div class="teaser__content">
  42. {% block card_title %}
  43. <h4 class="teaser__title">
  44. <a href="{{ profile_home }}">
  45. {{ profile_name }} {{ profile_name_extra }}
  46. </a>
  47. </h4>
  48. {% endblock %}
  49. {% block card_body %}
  50. {% if content.field_profile_function|render or content.field_profile_organization|render %}
  51. <div class="teaser__content-line">
  52. <svg class="teaser__content-type-icon">
  53. <use xlink:href="#icon-business_center"></use>
  54. </svg>
  55. <span class="teaser__content-text">
  56. {% if content.field_profile_organization|render %}
  57. {{ '@function at @organization'|t({'@function': content.field_profile_function|render, '@organization': content.field_profile_organization|render}) }}
  58. {% else %}
  59. {{ content.field_profile_function }}
  60. {% endif %}
  61. </span>
  62. </div>
  63. {% endif %}
  64. {% if content.field_profile_profile_tag['#items'] or badges %}
  65. <div style="margin-left: 30px; margin-top: 5px;">
  66. {% for badge in badges %}
  67. {% set badge_classes = badge.classes|merge(['badge']) %}
  68. <div{{ attributes.addClass(badge_classes) }}>{{ badge.label }}</div>
  69. {% endfor %}
  70. {% for item in content.field_profile_profile_tag['#items'] %}
  71. <div class="badge badge-default">{{ item.entity.label }}</div>
  72. {% endfor %}
  73. </div>
  74. {% endif %}
  75. {% endblock %}
  76. </div>
  77. <div class="card__actionbar">
  78. {% block card_actionbar %}
  79. <a href="{{ profile_contact_url }}" class="card__link">
  80. {% if profile_contact_label == 'private_message' %}
  81. {% trans %}Private message{% endtrans %}
  82. {% else %}
  83. {% trans %}View profile{% endtrans %}
  84. {% endif %}
  85. </a>
  86. <a href="{{ profile_stream_url }}" class="card__link hidden-for-phone-only">
  87. {% trans %}View activities{% endtrans %}
  88. </a>
  89. {% endblock %}
  90. </div>
  91. </div>
  92. </div>