Ivan Allen College of Liberal Arts Drupal Developers Cookbook

Available Twig Templates

Taken from /core/includes/theme.inc (base Twig templates found in /core/modules/system/templates/, but can be overridden by chosen site Drupal theme).

Property Description
table ['variables' => ['header' => NULL, 'rows' => NULL, 'footer' => NULL, 'attributes' => [], 'caption' => NULL, 'colgroups' => [], 'sticky' => FALSE, 'responsive' => TRUE, 'empty' => ''],]
item-list ['variables' => ['items' => [], 'title' => '', 'list_type' => 'ul', 'wrapper_attributes' => [], 'attributes' => [], 'empty' => NULL, 'context' => []],]
image ['variables' => ['uri' => NULL, 'width' => NULL, 'height' => NULL, 'alt' => '', 'title' => NULL, 'attributes' => [], 'sizes' => NULL, 'srcset' => [], 'style_name' => NULL],]
links ['variables' => ['links' => [], 'attributes' => ['class' => ['links']], 'heading' => [], 'set_active_class' => FALSE],]
input ['variables' => ['attributes' => [], 'children' => [],]
select ['variables' => ['attributes' => [], 'options' => [],]
radios ['variables' => ['attributes' => [], 'children' => [],]
Wrapper for a set of rendered radio buttons stored in 'children'
checkboxes ['variables' => ['attributes' => [], 'children' => [],]
Wrapper for a set of rendered checkboxes stored in 'children'
textarea ['variables' => ['wrapper_attributes' => [], ['attributes' => [], 'resizable' => "", 'required' => "", 'value' => "",]
vertical_tabs ['variables' => ['attributes' => [], 'children' => [],]
form ['variables' => ['attributes' => [], 'children' => [],]
Wrapper for a full form (provides the 'form' tag)
form-element Wrapper for any form element. See /core/modules/system/templates/form-element.html.twig for details on variables
fieldset Wrapper for a set of related fields. See /core/modules/system/templates/fieldset.html.twig for details on variables
details Wrapper for a details component. See /core/modules/system/templates/details.html.twig for details on variables
container ['variables' => ['attributes' => [], 'children' => [], 'has_parent' => "",]
General purpose theme for wrapping a set of children in a DIV element
time ['variables' => ['timestamp' => NULL, 'text' => NULL, 'attributes' => []],]
datetime_form
datetime_wrapper
dropbutton_wrapper ['variables' => ['children' => NULL],]
pager Page navigation controls for paged content. See /core/modules/system/templates/pager.html.twig for details on variables
menu Navigational menu. See /core/modules/system/templates/menu.html.twig for details on variables
menu_local_tasks Local tasks menu. See /core/modules/system/templates/menu-local-tasks.html.twig for details on variables
field Default theme for displaying a field
field_multiple_value_form Wrapper for editing a table of field items. See /core/modules/system/templates/field-multiple-value-form.html.twig
html HTML wrapper for all pages
page Content wrapper (defines all regions; usually overridden by Drupal site theme)
page_title ['variables' => ['title' => NULL]]
breadcrumb ['variables' => ['links' => []],]
status_messages ['variables' => ['status_headings' => [], 'message_list' => NULL],]
region Wrapper for an individual region on a page