You are here

subscription.html.twig in Mailing List 8

Default theme implementation to display a subscription.

Available variables:

  • subscription: The subscription entity with limited access to object properties and methods. Only method names starting with "get", "has", or "is" and a few common methods such as "id", "label", and "bundle" are available.
  • label: The title of the subscription.
  • email: The email address of the subscription.
  • content: All subscription items. Use {{ content }} to print them all, or print a subset such as {{ content.field_example }}. Use {{ content|without('field_example') }} to temporarily suppress the printing of a given child element.
  • metadata: Metadata for this node.
  • date: Themed creation date field.
  • author_name: Themed author name field.
  • url: Direct URL of the current node.
  • attributes: HTML attributes for the containing element. The attributes.class element may contain one or more of the following classes:

    • subscription: The current template type (also known as a "theming hook").
    • subscription--list-[mailing_list]: The mailing list which this subscription belongs.
    • subscription--view-mode-[view_mode]: The View Mode.

    The following are controlled through the subscription status.

    • subscription--active: Appears on active subscriptions.
  • title_attributes: Same as attributes, except applied to the main title tag that appears in the template.
  • content_attributes: Same as attributes, except applied to the main content tag that appears in the template.
  • author_attributes: Same as attributes, except applied to the author of the node tag that appears in the template.
  • title_prefix: Additional output populated by modules, intended to be displayed in front of the main title tag that appears in the template.
  • title_suffix: Additional output populated by modules, intended to be displayed after the main title tag that appears in the template.
  • view_mode: View mode; for example, "teaser" or "full".
  • logged_in: Flag for authenticated user status. Will be true when the current user is a logged-in member.
  • is_admin: Flag for admin user status. Will be true when the current user is an administrator.

File

templates/subscription.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to display a subscription.
  5. *
  6. * Available variables:
  7. * - subscription: The subscription entity with limited access to object properties
  8. * and methods. Only method names starting with "get", "has", or "is" and a
  9. * few common methods such as "id", "label", and "bundle" are available.
  10. * - label: The title of the subscription.
  11. * - email: The email address of the subscription.
  12. * - content: All subscription items. Use {{ content }} to print them all,
  13. * or print a subset such as {{ content.field_example }}. Use
  14. * {{ content|without('field_example') }} to temporarily suppress the printing
  15. * of a given child element.
  16. * - metadata: Metadata for this node.
  17. * - date: Themed creation date field.
  18. * - author_name: Themed author name field.
  19. * - url: Direct URL of the current node.
  20. * - attributes: HTML attributes for the containing element.
  21. * The attributes.class element may contain one or more of the following
  22. * classes:
  23. * - subscription: The current template type (also known as a "theming hook").
  24. * - subscription--list-[mailing_list]: The mailing list which this subscription belongs.
  25. * - subscription--view-mode-[view_mode]: The View Mode.
  26. * The following are controlled through the subscription status.
  27. * - subscription--active: Appears on active subscriptions.
  28. * - title_attributes: Same as attributes, except applied to the main title
  29. * tag that appears in the template.
  30. * - content_attributes: Same as attributes, except applied to the main
  31. * content tag that appears in the template.
  32. * - author_attributes: Same as attributes, except applied to the author of
  33. * the node tag that appears in the template.
  34. * - title_prefix: Additional output populated by modules, intended to be
  35. * displayed in front of the main title tag that appears in the template.
  36. * - title_suffix: Additional output populated by modules, intended to be
  37. * displayed after the main title tag that appears in the template.
  38. * - view_mode: View mode; for example, "teaser" or "full".
  39. * - logged_in: Flag for authenticated user status. Will be true when the
  40. * current user is a logged-in member.
  41. * - is_admin: Flag for admin user status. Will be true when the current user
  42. * is an administrator.
  43. *
  44. * @see template_preprocess_subscription()
  45. *
  46. * @ingroup themeable
  47. */
  48. #}
  49. <section{{ attributes }}>
  50. {{ title_prefix }}
  51. <div>{{ email }}</div>
  52. {{ title_suffix }}
  53. <div{{ content_attributes }}>
  54. {{ content }}
  55. </div>
  56. </section>