You are here

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

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. <a href="{{ profile_home }}" class="teaser__image">
  25. {% if content.field_profile_image %}
  26. {{ content.field_profile_image }}
  27. {% endif %}
  28. </a>
  29. <div class="teaser__body">
  30. <div class="teaser__content">
  31. <h4 class="teaser__title">
  32. <a href="{{ profile_home }}">
  33. {{ profile_name }} {{ profile_name_extra }}
  34. </a>
  35. </h4>
  36. {% if content.field_profile_function|render or content.field_profile_organization|render %}
  37. <div class="teaser__content-line">
  38. <svg class="teaser__content-type-icon">
  39. <use xlink:href="#icon-business_center"></use>
  40. </svg>
  41. <span class="teaser__content-text">
  42. {% if content.field_profile_organization|render %}
  43. {{ '@function at @organization'|t({'@function': content.field_profile_function|render, '@organization': content.field_profile_organization|render}) }}
  44. {% else %}
  45. {{ content.field_profile_function }}
  46. {% endif %}
  47. </span>
  48. </div>
  49. {% endif %}
  50. {% if content.field_profile_profile_tag['#items'] or badges %}
  51. <div style="margin-left: 30px; margin-top: 5px;">
  52. {% for badge in badges %}
  53. {% set badge_classes = badge.classes|merge(['badge']) %}
  54. <div{{ attributes.addClass(badge_classes) }}>{{ badge.label }}</div>
  55. {% endfor %}
  56. {% for item in content.field_profile_profile_tag['#items'] %}
  57. <div class="badge badge-default">{{ item.entity.label }}</div>
  58. {% endfor %}
  59. </div>
  60. {% endif %}
  61. </div>
  62. <div class="card__actionbar">
  63. <a href="{{ profile_contact_url }}" class="card__link">
  64. {% if profile_contact_label == 'private_message' %}
  65. {% trans %}Private message{% endtrans %}
  66. {% else %}
  67. {% trans %}View profile{% endtrans %}
  68. {% endif %}
  69. </a>
  70. <a href="{{ profile_stream_url }}" class="card__link hidden-for-phone-only">
  71. {% trans %}View activities{% endtrans %}
  72. </a>
  73. </div>
  74. </div>
  75. </div>