You are here

profile--profile--hero.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--hero.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/hero')}}
  23. {% if profile_hero_styled_image_url %}
  24. <div style="background-image: url('{{ profile_hero_styled_image_url }}')" class="cover cover-img cover-img-gradient">
  25. {% else %}
  26. <div class="cover">
  27. {% endif %}
  28. <div class="hero__bgimage-overlay"></div>
  29. {% if profile_edit_url %}
  30. <div class="hero-action-button">
  31. <a href="{{ profile_edit_url }}" title="{% trans %}Edit profile information{% endtrans %}" class="btn btn-raised btn-default btn-floating">
  32. <svg class="icon-medium">
  33. <title>{% trans %}Edit profile information{% endtrans %}</title>
  34. <use xlink:href="#icon-edit"></use>
  35. </svg>
  36. </a>
  37. </div>
  38. {% endif %}
  39. <div class="cover-wrap">
  40. <header>
  41. {{ content.field_profile_image }}
  42. <h1 class="page-title">
  43. {{ profile_name }} {{ profile_name_extra }}
  44. </h1>
  45. </header>
  46. {% if (content.field_profile_function|render or content.field_profile_organization|render) or profile_contact_label == 'private_message' %}
  47. <footer class="hero-footer">
  48. {% endif %}
  49. <div class="hero-footer__text">
  50. {% if content.field_profile_function|render %}
  51. <strong>{{ content.field_profile_function }}</strong>
  52. {% endif %}
  53. {% if (content.field_profile_function|render and content.field_profile_organization|render) %}
  54. &nbsp;-&nbsp;
  55. {% endif %}
  56. {{ content.field_profile_organization }}
  57. </div>
  58. {% if profile_contact_label == 'private_message' %}
  59. <div class="hero-footer__cta">
  60. <a href="{{ profile_contact_url }}" class="btn btn-accent btn-lg btn-raised">
  61. {% trans %} Private message {% endtrans %}
  62. </a>
  63. </div>
  64. {% endif %}
  65. {% if (content.field_profile_function|render or content.field_profile_organization|render) or profile_contact_label == 'private_message' %}
  66. </footer>
  67. {% endif %}
  68. {# render other fields that developers might add #}
  69. {{ content|without('field_profile_first_name', 'field_profile_last_name', 'field_profile_image', 'field_profile_function', 'field_profile_organization') }}
  70. </div>
  71. </div>