Functions and templates for the user interface to be implemented by themes.
Drupal's presentation layer is a pluggable system known as the theme layer. Each theme can take control over most of Drupal's output, and has complete control over the CSS.
Inside Drupal, the theme layer is utilized by the use of the theme() function, which is passed the name of a component (the theme hook) and an array of variables. For example, theme('table', array('header' => $header, 'rows' => $rows)); Additionally, the theme() function can take an array of theme hooks, which can be used to provide 'fallback' implementations to allow for more specific control of output. For example, the function: theme(array('table__foo', 'table'), $variables) would look to see if 'table__foo' is registered anywhere; if it is not, it would 'fall back' to the generic 'table' implementation. This can be used to attach specific theme functions to named objects, allowing the themer more control over specific types of output.
As of Drupal 6, every theme hook is required to be registered by the module that owns it, so that Drupal can tell what to do with it and to make it simple for themes to identify and override the behavior for these calls.
The theme hooks are registered via hook_theme(), which returns an array of arrays with information about the hook. It describes the arguments the function or template will need, and provides defaults for the template in case they are not filled in. If the default implementation is a function, by convention it is named theme_HOOK().
Each module should provide a default implementation for theme_hooks that it registers. This implementation may be either a function or a template; if it is a function it must be specified via hook_theme(). By convention, default implementations of theme hooks are named theme_HOOK. Default template implementations are stored in the module directory.
Drupal's default template renderer is Twig. Drupal's theme engines can provide alternate template engines, such as XTemplate, Smarty and PHPTal.
In order to create theme-specific implementations of these hooks, themes can implement their own version of theme hooks, either as functions or templates. These implementations will be used instead of the default implementation. If using a pure .theme without an engine, the .theme is required to implement its own version of hook_theme() to tell Drupal what it is implementing; themes utilizing an engine will have their well-named theming functions automatically registered for them. While this can vary based upon the theme engine, the standard is that theme functions should be named THEMENAME_HOOK. For example, for Drupal's default theme (Bartik) to implement the 'table' hook, the theme function should be called bartik_table().
The theme system is described and defined in theme.inc.
End of "defgroup themeable".
theme()
Name![]() |
Location | Description |
---|---|---|
drupal_pre_render_table |
drupal/ |
#pre_render callback to transform children of an element into #rows suitable for theme_table(). |
template_preprocess_datetime |
drupal/ |
Preprocess variables for theme_datetime(). |
template_preprocess_input |
drupal/ |
Preprocesses variables for theme_input(). |
template_preprocess_item_list |
drupal/ |
Preprocesses variables for theme_item_list(). |
theme_admin_block |
drupal/ |
Returns HTML for an administrative block for display. |
theme_admin_block_content |
drupal/ |
Returns HTML for the content of an administrative block. |
theme_admin_page |
drupal/ |
Returns HTML for an administrative page. |
theme_aggregator_block_item |
drupal/ |
Returns HTML for an individual feed item for display in the block. |
theme_aggregator_page_opml |
drupal/ |
Prints the OPML page for the feed. |
theme_aggregator_page_rss |
drupal/ |
Prints the RSS page for a feed. |
theme_authorize_message |
drupal/ |
Returns HTML for a single log message from the authorize.php batch operation. |
theme_authorize_report |
drupal/ |
Returns HTML for a results report of an operation run by authorize.php. |
theme_book_admin_table |
drupal/ |
Returns HTML for a book administration form. |
theme_breadcrumb |
drupal/ |
Returns HTML for a breadcrumb trail. |
theme_checkboxes |
drupal/ |
Returns HTML for a set of checkbox form elements. |
theme_comment_block |
drupal/ |
Returns HTML for a list of recent comments. |
theme_comment_post_forbidden |
drupal/ |
Returns HTML for a "you can't post comments" notice. |
theme_confirm_form |
drupal/ |
Returns HTML for a confirmation form. |
theme_container |
drupal/ |
Returns HTML to wrap child elements in a container. |
theme_date |
drupal/ |
Returns HTML for an #date form element. |
theme_datelist_form |
drupal/ |
Returns HTML for a date selection form element. |
theme_datetime |
drupal/ |
Returns HTML for a date / time. |
theme_datetime_form |
drupal/ |
Returns HTML for a HTML5-compatible #datetime form element. |
theme_datetime_wrapper |
drupal/ |
Returns HTML for a datetime form element. |
theme_details |
drupal/ |
Returns HTML for a details form element and its children. |
theme_dropbutton_wrapper |
drupal/ |
Returns HTML for wrapping a dropbutton menu. |
theme_exposed_filters |
drupal/ |
Returns HTML for an exposed filter form. |
theme_feed_icon |
drupal/ |
Returns HTML for a feed icon. |
theme_field |
drupal/ |
Returns HTML for a field. |
theme_fieldset |
drupal/ |
Returns HTML for a fieldset form element and its children. |
theme_field_multiple_value_form |
drupal/ |
Returns HTML for an individual form element. |
theme_field_ui_table |
drupal/ |
Returns HTML for Field UI overview tables. |
theme_file_formatter_table |
drupal/ |
Returns HTML for a file attachments table. |
theme_file_icon |
drupal/ |
Returns HTML for an image with an appropriate icon for the given file. |
theme_file_link |
drupal/ |
Returns HTML for a link to a file. |
theme_file_managed_file |
drupal/ |
Returns HTML for a managed file element. |
theme_file_upload_help |
drupal/ |
Returns HTML for help text based on file upload validators. |
theme_file_widget |
drupal/ |
Returns HTML for an individual file upload widget. |
theme_file_widget_multiple |
drupal/ |
Returns HTML for a group of file upload widgets. |
theme_filter_guidelines |
drupal/ |
Returns HTML for guidelines for a text format. |
theme_filter_html_image_secure_image |
drupal/ |
Formats an image DOM element that has an invalid source. |
theme_filter_tips |
drupal/ |
Returns HTML for a set of filter tips. |
theme_form |
drupal/ |
Returns HTML for a form. |
theme_form_element |
drupal/ |
Returns HTML for a form element. |
theme_form_element_label |
drupal/ |
Returns HTML for a form element label and required marker. |
theme_form_required_marker |
drupal/ |
Returns HTML for a marker for required form elements. |
theme_forum_form |
drupal/ |
Returns HTML for a forum form. |
theme_image |
drupal/ |
Returns HTML for an image. |
theme_image_anchor |
drupal/ |
Returns HTML for a 3x3 grid of checkboxes for image anchors. |
theme_image_crop_summary |
drupal/ |
Returns HTML for a summary of an image crop effect. |
theme_image_formatter |
drupal/ |
Returns HTML for an image field formatter. |
theme_image_resize_summary |
drupal/ |
Returns HTML for a summary of an image resize effect. |
theme_image_rotate_summary |
drupal/ |
Returns HTML for a summary of an image rotate effect. |
theme_image_scale_summary |
drupal/ |
Returns HTML for a summary of an image scale effect. |
theme_image_style |
drupal/ |
Returns HTML for an image using a specific image style. |
theme_image_style_effects |
drupal/ |
Returns HTML for a listing of the effects within a specific image style. |
theme_image_style_list |
drupal/ |
Returns HTML for the page containing the list of image styles. |
theme_image_style_preview |
drupal/ |
Returns HTML for a preview of an image style. |
theme_image_widget |
drupal/ |
Returns HTML for an image field widget. |
theme_indentation |
drupal/ |
Returns HTML for an indentation div; used for drag and drop tables. |
theme_input |
drupal/ |
Returns HTML for an input form element. |
theme_item_list |
drupal/ |
Returns HTML for a list or nested list of items. |
theme_language_negotiation_configure_browser_form_table |
drupal/ |
Theme browser configuration form as table. |
theme_language_negotiation_configure_form |
drupal/ |
Returns HTML for the language negotiation configuration form. |
theme_link |
drupal/ |
Returns HTML for a link. |
theme_links |
drupal/ |
Returns HTML for a set of links. |
theme_locale_translate_edit_form_strings |
drupal/ |
Returns HTML for translation edit form. |
theme_locale_translation_last_check |
drupal/ |
Returns HTML for the last time we checked for update data. |
theme_locale_translation_update_info |
drupal/ |
Returns HTML for translation status information per language. |
theme_mark |
drupal/ |
Returns HTML for a marker for new or updated content. |
theme_menu_link |
drupal/ |
Returns HTML for a menu link and submenu. |
theme_menu_local_action |
drupal/ |
Returns HTML for a single local action link. |
theme_menu_local_task |
drupal/ |
Returns HTML for a single local task link. |
theme_menu_local_tasks |
drupal/ |
Returns HTML for primary and secondary local tasks. |
theme_menu_overview_form |
drupal/ |
Returns HTML for the menu overview form into a table. |
theme_menu_tree |
drupal/ |
Returns HTML for a wrapper for a menu sub-tree. |
theme_meter |
drupal/ |
Returns HTML for a meter. |
theme_more_help_link |
drupal/ |
Returns HTML for a "more help" link. |
theme_more_link |
drupal/ |
Returns HTML for a "more" link, like those used in blocks. |
theme_node_add_list |
drupal/ |
Returns HTML for a list of available node types for node creation. |
theme_node_admin_overview |
drupal/ |
Returns HTML for a node type description for the content type admin page. |
theme_node_preview |
drupal/ |
Returns HTML for a node preview for display during node creation and editing. |
theme_node_recent_block |
drupal/ |
Returns HTML for a list of recent content. |
theme_node_recent_content |
drupal/ |
Returns HTML for a recent node to be displayed in the recent content block. |
theme_node_search_admin |
drupal/ |
Returns HTML for the content ranking part of the search settings admin page. |
theme_pager |
drupal/ |
Returns HTML for a query pager. |
theme_pager_link |
drupal/ |
Returns HTML for a link to a specific query result page. |
theme_picture |
drupal/ |
Returns HTML for a picture. |
theme_picture_formatter |
drupal/ |
Returns HTML for a picture field formatter. |
theme_picture_source |
drupal/ |
Returns HTML for a source tag. |
theme_progress_bar |
drupal/ |
Returns HTML for a progress bar. |
theme_radios |
drupal/ |
Returns HTML for a set of radio button form elements. |
theme_rdf_metadata |
drupal/ |
Returns HTML for a series of empty spans for exporting RDF metadata in RDFa. |
theme_rdf_template_variable_wrapper |
drupal/ |
Returns HTML for a template variable wrapped in an HTML element with the RDF attributes. |
theme_select |
drupal/ |
Returns HTML for a select form element. |
theme_shortcut_set_customize |
drupal/ |
Returns HTML for a shortcut set customization form. |
theme_simpletest_result_summary |
drupal/ |
Returns HTML for the summary status of a simpletest result. |
theme_simpletest_test_table |
drupal/ |
Returns HTML for a test list generated by simpletest_test_form() into a table. |
theme_status_messages |
drupal/ |
Returns HTML for status and/or error messages, grouped by type. |
theme_status_report |
drupal/ |
Returns HTML for the status report. |
theme_system_admin_index |
drupal/ |
Returns HTML for the output of the admin index page. |
theme_system_compact_link |
drupal/ |
Returns HTML for a link to show or hide inline help descriptions. |
theme_system_config_form |
drupal/ |
Returns HTML for a system settings form. |
theme_system_date_format_localize_form |
drupal/ |
Returns HTML for a locale date format form. |
theme_system_modules_details |
drupal/ |
Returns HTML for the modules form. |
theme_system_modules_incompatible |
drupal/ |
Returns HTML for a message about incompatible modules. |
theme_system_modules_uninstall |
drupal/ |
Returns HTML for a table of currently disabled modules. |
theme_system_powered_by |
drupal/ |
Returns HTML for the Powered by Drupal text. |
theme_system_themes_page |
drupal/ |
Returns HTML for the Appearance page. |
theme_table |
drupal/ |
Returns HTML for a table. |
theme_tableselect |
drupal/ |
Returns HTML for a table with radio buttons or checkboxes. |
theme_tablesort_indicator |
drupal/ |
Returns HTML for a sort icon. |
theme_task_list |
drupal/ |
Returns HTML for a list of maintenance tasks to perform. |
theme_textarea |
drupal/ |
Returns HTML for a textarea form element. |
theme_text_format_wrapper |
drupal/ |
Returns HTML for a text format-enabled form element. |
theme_update_last_check |
drupal/ |
Returns HTML for the last time we checked for update data. |
theme_update_manager_update_form |
drupal/ |
Returns HTML for the first page in the process of updating projects. |
theme_update_report |
drupal/ |
Returns HTML for the project status report. |
theme_update_status_label |
drupal/ |
Returns HTML for a label to display for a project's update status. |
theme_update_version |
drupal/ |
Returns HTML for the version display of a project. |
theme_user_admin_permissions |
drupal/ |
Returns HTML for the administer permissions page. |
theme_user_permission_description |
drupal/ |
Returns HTML for an individual permission description. |
theme_user_signature |
drupal/ |
Returns HTML for a user signature. |
theme_vertical_tabs |
drupal/ |
Returns HTML for an element's children details as vertical tabs. |
Name![]() |
Location | Description |
---|---|---|
aggregator-feed-source.html.twig |
drupal/ |
Default theme implementation to present the source of the feed. |
aggregator-item.html.twig |
drupal/ |
Default theme implementation to present a feed item in an aggregator page. |
aggregator-summary-items.html.twig |
drupal/ |
Default theme implementation to present feeds as list items. |
block.html.twig |
drupal/ |
Default theme implementation to display a block. |
book-all-books-block.html.twig |
drupal/ |
Default theme implementation for rendering book outlines within a block. |
book-export-html.html.twig |
drupal/ |
Default theme implementation for printed version of book outline. |
book-navigation.html.twig |
drupal/ |
Default theme implementation to navigate books. |
book-node-export-html.html.twig |
drupal/ |
Default theme implementation for a single node in a printer-friendly outline. |
color-scheme-form.html.twig |
drupal/ |
Default theme implementation for a theme's color form. |
comment-wrapper.html.twig |
drupal/ |
Default theme implementation for a comments container. |
comment.html.twig |
drupal/ |
Default theme implementation for comments. |
comment.html.twig |
drupal/ |
Bartik's theme implementation for comments. |
custom-block-add-list.html.twig |
drupal/ |
Default theme implementation to present a list of custom block types. |
field.html.twig |
drupal/ |
Default theme implementation for a field. |
forum-icon.html.twig |
drupal/ |
Default theme implementation to display a status icon for a forum post. |
forum-list.html.twig |
drupal/ |
Default theme implementation to display a list of forums and containers. |
forum-submitted.html.twig |
drupal/ |
Default theme implementation for a forum post submission string. |
forum-topic-list.html.twig |
drupal/ |
Default theme implementation to display a list of forum topics. |
forums.html.twig |
drupal/ |
Default theme implementation to display a forum. |
html.html.twig |
drupal/ |
Default theme implementation for the basic structure of a single Drupal page. |
maintenance-page.html.twig |
drupal/ |
Default theme implementation to display a single Drupal page while offline. |
maintenance-page.html.twig |
drupal/ |
Seven's theme implementation to display a single Drupal page while offline. |
maintenance-page.html.twig |
drupal/ |
Bartik's theme implementation to display a single Drupal page while offline. |
node-edit-form.html.twig |
drupal/ |
Two column template for the node add/edit form. |
node.html.twig |
drupal/ |
Default theme implementation to display a node. |
node.html.twig |
drupal/ |
Bartik's theme implementation to display a node. |
one-col.html.twig |
drupal/ |
Template for a 1 column layout. |
one-col.html.twig |
drupal/ |
Template for a one column layout. |
overlay-disable-message.html.twig |
drupal/ |
Default theme implementation for the message about disabling the overlay. |
overlay.html.twig |
drupal/ |
Default theme implementation to display a page in the overlay. |
page.html.twig |
drupal/ |
Default theme implementation to display a single page. |
page.html.twig |
drupal/ |
Seven's theme implementation to display a single Drupal page. |
page.html.twig |
drupal/ |
Bartik's theme implementation to display a single page. |
region.html.twig |
drupal/ |
Default theme implementation to display a region. |
search-result.html.twig |
drupal/ |
Default theme implementation for displaying a single search result. |
search-results.html.twig |
drupal/ |
Default theme implementation for displaying search results. |
system-plugin-ui-form.html.twig |
drupal/ |
Default theme implementation to configure blocks. |
taxonomy-term.html.twig |
drupal/ |
Default theme implementation to display a taxonomy term. |
two-col.html.twig |
drupal/ |
Template for a 2 column layout. |
two-col.html.twig |
drupal/ |
Template for a 2 column layout. |
user.html.twig |
drupal/ |
Default theme implementation to present all user data. |
views-exposed-form.html.twig |
drupal/ |
Default theme implementation of a views exposed form. |
views-more.html.twig |
drupal/ |
Default theme implementation for a views "more" link. |
views-ui-display-tab-bucket.html.twig |
drupal/ |
Default theme implementation for each "box" on the display query edit screen. |
views-ui-display-tab-setting.html.twig |
drupal/ |
Default theme implementation for Views UI display tab settings. |
views-view--frontpage.html.twig |
drupal/ |
Default theme implementation for the frontpage view template. |
views-view-field.html.twig |
drupal/ |
Default theme implementation for a single field in a view. |
views-view-fields.html.twig |
drupal/ |
Default view template to display all the fields in a row. |
views-view-grid.html.twig |
drupal/ |
Default theme implementation for views to display rows in a grid. |
views-view-grouping.html.twig |
drupal/ |
Default theme implementation to display a single views grouping. |
views-view-list.html.twig |
drupal/ |
Default theme implementation for a view template to display a list of rows. |
views-view-row-rss.html.twig |
drupal/ |
Default theme implementation to display an item in a views RSS feed. |
views-view-rss.html.twig |
drupal/ |
Default template for feed displays that use the RSS style. |
views-view-summary-unformatted.html.twig |
drupal/ |
Default theme implementation for unformatted summary links. |
views-view-summary.html.twig |
drupal/ |
Default theme implementation to display a list of summary lines. |
views-view-table.html.twig |
drupal/ |
Default theme implementation for displaying a view as a table. |
views-view-unformatted.html.twig |
drupal/ |
Default theme implementation to display a view of unformatted rows. |
views-view.html.twig |
drupal/ |
Default theme implementation for main view template. |