You are here

profile--profile--teaser--anonymous.html.twig in Open Social 8.2

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--anonymous.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. <div class="teaser__image">
  25. {% if content.field_profile_image %}
  26. {{ content.field_profile_image }}
  27. {% endif %}
  28. </div>
  29. <div class="teaser__body">
  30. <div class="teaser__content">
  31. <h4 class="teaser__title">
  32. {{ profile_name }}
  33. </h4>
  34. {% if content.field_profile_function|render or content.field_profile_organization|render %}
  35. <div class="teaser__content-line">
  36. <svg class="teaser__content-type-icon">
  37. <use xlink:href="#icon-business_center"></use>
  38. </svg>
  39. <span class="teaser__content-text">
  40. {% if content.field_profile_organization|render %}
  41. {{ '@function at @organization'|t({'@function': content.field_profile_function|render, '@organization': content.field_profile_organization|render}) }}
  42. {% else %}
  43. {{ content.field_profile_function }}
  44. {% endif %}
  45. </span>
  46. </div>
  47. {% endif %}
  48. {% if content.field_profile_profile_tag['#items'] or badges %}
  49. <div style="margin-left: 30px; margin-top: 5px;">
  50. {% for badge in badges %}
  51. {% set badge_classes = badge.classes|merge(['badge']) %}
  52. <div{{ attributes.addClass(badge_classes) }}>{{ badge.label }}</div>
  53. {% endfor %}
  54. {% for item in content.field_profile_profile_tag['#items'] %}
  55. <div class="badge badge-default">{{ item.entity.label }}</div>
  56. {% endfor %}
  57. </div>
  58. {% endif %}
  59. </div>
  60. </div>
  61. </div>