You are here

profile--profile--hero.html.twig in Open Social 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. <use xlink:href="#icon-edit"></use>
  34. </svg>
  35. </a>
  36. </div>
  37. {% endif %}
  38. <div class="cover-wrap">
  39. <header>
  40. {{ content.field_profile_image }}
  41. <h1 class="page-title">
  42. {{ profile_name }}
  43. </h1>
  44. </header>
  45. {% if (content.field_profile_function|render or content.field_profile_organization|render) or profile_contact_label == 'private_message' %}
  46. <footer class="hero-footer">
  47. {% endif %}
  48. <div class="hero-footer__text">
  49. {% if content.field_profile_function|render %}
  50. <strong>{{ content.field_profile_function }}</strong>
  51. {% endif %}
  52. {% if (content.field_profile_function|render and content.field_profile_organization|render) %}
  53. &nbsp;-&nbsp;
  54. {% endif %}
  55. {{ content.field_profile_organization }}
  56. </div>
  57. {% if profile_contact_label == 'private_message' %}
  58. <div class="hero-footer__cta">
  59. <a href="{{ profile_contact_url }}" class="btn btn-accent btn-lg btn-raised">
  60. {% trans %} Private message {% endtrans %}
  61. </a>
  62. </div>
  63. {% endif %}
  64. {% if (content.field_profile_function|render or content.field_profile_organization|render) or profile_contact_label == 'private_message' %}
  65. </footer>
  66. {% endif %}
  67. {# render other fields that developers might add #}
  68. {{ content|without('field_profile_first_name', 'field_profile_last_name', 'field_profile_image', 'field_profile_function', 'field_profile_organization') }}
  69. </div>
  70. </div>