sample files from a smithsonian project
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a 'checkboxes' #type form element.
|
||||
*
|
||||
* Available variables
|
||||
* - attributes: A list of HTML attributes for the wrapper element.
|
||||
* - children: The rendered checkboxes.
|
||||
*
|
||||
* @see template_preprocess_checkboxes()
|
||||
*/
|
||||
@todo: remove this file once https://www.drupal.org/node/1819284 is resolved.
|
||||
This is identical to core/modules/system/templates/container.html.twig
|
||||
#}
|
||||
{% include "@elements/forms/_checkboxes.twig" %}
|
||||
@@ -0,0 +1,22 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for an individual form element.
|
||||
*
|
||||
* Available variables for all fields:
|
||||
* - multiple: Whether there are multiple instances of the field.
|
||||
*
|
||||
* Available variables for single cardinality fields:
|
||||
* - elements: Form elements to be rendered.
|
||||
*
|
||||
* Available variables when there are multiple fields.
|
||||
* - table: Table of field items.
|
||||
* - description: The description element containing the following properties:
|
||||
* - content: The description content of the form element.
|
||||
* - attributes: HTML attributes to apply to the description container.
|
||||
* - button: "Add another item" button.
|
||||
*
|
||||
* @see template_preprocess_field_multiple_value_form()
|
||||
*/
|
||||
#}
|
||||
{% include "@elements/forms/_multi-value.twig" %}
|
||||
@@ -0,0 +1,23 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a fieldset element and its children.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: HTML attributes for the fieldset element.
|
||||
* - errors: (optional) Any errors for this fieldset element, may not be set.
|
||||
* - required: Boolean indicating whether the fieldeset element is required.
|
||||
* - legend: The legend element containing the following properties:
|
||||
* - title: Title of the fieldset, intended for use as the text of the legend.
|
||||
* - attributes: HTML attributes to apply to the legend.
|
||||
* - description: The description element containing the following properties:
|
||||
* - content: The description content of the fieldset.
|
||||
* - attributes: HTML attributes to apply to the description container.
|
||||
* - children: The rendered child elements of the fieldset.
|
||||
* - prefix: The content to add before the fieldset children.
|
||||
* - suffix: The content to add after the fieldset children.
|
||||
*
|
||||
* @see template_preprocess_fieldset()
|
||||
*/
|
||||
#}
|
||||
{% include "@elements/forms/_fieldset.twig" %}
|
||||
@@ -0,0 +1,15 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a form element label.
|
||||
*
|
||||
* Available variables:
|
||||
* - title: The label's text.
|
||||
* - title_display: Elements title_display setting.
|
||||
* - required: An indicator for whether the associated form element is required.
|
||||
* - attributes: A list of HTML attributes for the label.
|
||||
*
|
||||
* @see template_preprocess_form_element_label()
|
||||
*/
|
||||
#}
|
||||
{% include "@elements/forms/_form-label.twig" %}
|
||||
@@ -0,0 +1,59 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a form element.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: HTML attributes for the containing element.
|
||||
* - errors: (optional) Any errors for this form element, may not be set.
|
||||
* - 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.
|
||||
*
|
||||
* @see template_preprocess_form_element()
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'js-form-item',
|
||||
'form-item',
|
||||
'js-form-type-' ~ type|clean_class,
|
||||
'form-item-' ~ name|clean_class,
|
||||
'js-form-item-' ~ name|clean_class,
|
||||
title_display not in ['after', 'before'] ? 'form-no-label',
|
||||
disabled == 'disabled' ? 'form-disabled',
|
||||
errors ? 'form-item--error',
|
||||
]
|
||||
%}
|
||||
{% include "@elements/forms/_form-element.twig" %}
|
||||
@@ -0,0 +1,13 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for an 'input' #type form element.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: A list of HTML attributes for the input element.
|
||||
* - children: Optional additional rendered elements.
|
||||
*
|
||||
* @see template_preprocess_input()
|
||||
*/
|
||||
#}
|
||||
{% include "@elements/forms/_input.twig" %}
|
||||
@@ -0,0 +1,13 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a 'radios' #type form element.
|
||||
*
|
||||
* Available variables
|
||||
* - attributes: A list of HTML attributes for the wrapper element.
|
||||
* - children: The rendered radios.
|
||||
*
|
||||
* @see template_preprocess_radios()
|
||||
*/
|
||||
#}
|
||||
{% include "@elements/forms/_radios.twig" %}
|
||||
@@ -0,0 +1,13 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a select element.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: HTML attributes for the select tag.
|
||||
* - options: The option element children.
|
||||
*
|
||||
* @see template_preprocess_select()
|
||||
*/
|
||||
#}
|
||||
{% include "@elements/forms/_select-element.twig" %}
|
||||
@@ -0,0 +1,16 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a 'textarea' #type form element.
|
||||
*
|
||||
* Available variables
|
||||
* - wrapper_attributes: A list of HTML attributes for the wrapper element.
|
||||
* - attributes: A list of HTML attributes for the textarea element.
|
||||
* - resizable: An indicator for whether the textarea is resizable.
|
||||
* - required: An indicator for whether the textarea is required.
|
||||
* - value: The textarea content.
|
||||
*
|
||||
* @see template_preprocess_textarea()
|
||||
*/
|
||||
#}
|
||||
{% include "@elements/forms/_textarea.twig" %}
|
||||
Reference in New Issue
Block a user