You are here

form-element--field-post-image.html.twig in Open Social 8.2

Default theme implementation for a form element.

Available variables:

  • attributes: HTML attributes for the containing element.
  • prefix: (optional) The form element prefix, may not be set.
  • suffix: (optional) The form element suffix, may not be set.
  • required: The required marker, or empty if the associated form element is not required.
  • type: The type of the element.
  • name: The name of the element.
  • label: A rendered label element.
  • label_display: Label display setting. It can have these values:
    • before: The label is output before the element. This is the default. The label includes the #title and the required marker, if #required.
    • after: The label is output after the element. For example, this is used for radio and checkbox #type elements. If the #title is empty but the field is #required, the label will contain only the required marker.
    • invisible: Labels are critical for screen readers to enable them to properly navigate through forms but can be visually distracting. This property hides the label for everyone except screen readers.
    • attribute: Set the title attribute on the element to create a tooltip but output no label element. This is supported only for checkboxes and radios in \Drupal\Core\Render\Element\CompositeFormElementTrait::preRenderCompositeFormElement(). It is used where a visual label is not needed, such as a table of checkboxes where the row and column provide the context. The tooltip will include the title and required marker.
  • description: (optional) A list of description properties containing:
    • content: A description of the form element, may not be set.
    • attributes: (optional) A list of HTML attributes to apply to the description content wrapper. Will only be set when description is set.
  • description_display: Description display setting. It can have these values:
    • before: The description is output before the element.
    • after: The description is output after the element. This is the default value.
    • invisible: The description is output after the element, hidden visually but available to screen readers.
  • disabled: True if the element is disabled.
  • title_display: Title display setting.

File

themes/socialbase/templates/form/form-element--field-post-image.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for a form element.
  5. *
  6. * Available variables:
  7. * - attributes: HTML attributes for the containing element.
  8. * - prefix: (optional) The form element prefix, may not be set.
  9. * - suffix: (optional) The form element suffix, may not be set.
  10. * - required: The required marker, or empty if the associated form element is
  11. * not required.
  12. * - type: The type of the element.
  13. * - name: The name of the element.
  14. * - label: A rendered label element.
  15. * - label_display: Label display setting. It can have these values:
  16. * - before: The label is output before the element. This is the default.
  17. * The label includes the #title and the required marker, if #required.
  18. * - after: The label is output after the element. For example, this is used
  19. * for radio and checkbox #type elements. If the #title is empty but the
  20. * field is #required, the label will contain only the required marker.
  21. * - invisible: Labels are critical for screen readers to enable them to
  22. * properly navigate through forms but can be visually distracting. This
  23. * property hides the label for everyone except screen readers.
  24. * - attribute: Set the title attribute on the element to create a tooltip but
  25. * output no label element. This is supported only for checkboxes and radios
  26. * in \Drupal\Core\Render\Element\CompositeFormElementTrait::preRenderCompositeFormElement().
  27. * It is used where a visual label is not needed, such as a table of
  28. * checkboxes where the row and column provide the context. The tooltip will
  29. * include the title and required marker.
  30. * - description: (optional) A list of description properties containing:
  31. * - content: A description of the form element, may not be set.
  32. * - attributes: (optional) A list of HTML attributes to apply to the
  33. * description content wrapper. Will only be set when description is set.
  34. * - description_display: Description display setting. It can have these values:
  35. * - before: The description is output before the element.
  36. * - after: The description is output after the element. This is the default
  37. * value.
  38. * - invisible: The description is output after the element, hidden visually
  39. * but available to screen readers.
  40. * - disabled: True if the element is disabled.
  41. * - title_display: Title display setting.
  42. *
  43. * @see template_preprocess_form_element()
  44. *
  45. * @ingroup templates
  46. */
  47. #}
  48. {{ children }}