Default theme implementations

  1. 7 core/modules/system/theme.api.php themeable
  2. 6 core/includes/theme.inc themeable

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 a simple PHP parsing engine that includes the template and stores the output. Drupal's theme engines can provide alternate template engines, such as XTemplate, Smarty and PHPTal. The most common template engine is PHPTemplate (included with Drupal and implemented in phptemplate.engine, which uses Drupal's default template renderer.

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 set by phptemplate is that theme functions should be named THEMENAME_HOOK. For example, for Drupal's default theme (Bartik) to implement the 'table' hook, the phptemplate.engine would find bartik_table().

The theme system is described and defined in theme.inc.

End of "defgroup themeable".

See also

theme()

hook_theme()

Hooks

Callbacks

File

core/modules/system/theme.api.php, line 3

Functions

Namesort descending Location Description
theme_admin_block core/modules/system/system.admin.inc Returns HTML for an administrative block for display.
theme_admin_block_content core/modules/system/system.admin.inc Returns HTML for the content of an administrative block.
theme_admin_page core/modules/system/system.admin.inc Returns HTML for an administrative page.
theme_aggregator_block_item core/modules/aggregator/aggregator.module Returns HTML for an individual feed item for display in the block.
theme_aggregator_categorize_items core/modules/aggregator/aggregator.pages.inc Returns HTML for the aggregator page list form for assigning categories.
theme_aggregator_page_opml core/modules/aggregator/aggregator.pages.inc Prints the OPML page for the feed.
theme_aggregator_page_rss core/modules/aggregator/aggregator.pages.inc Prints the RSS page for a feed.
theme_authorize_message core/includes/theme.maintenance.inc Returns HTML for a single log message from the authorize.php batch operation.
theme_authorize_report core/includes/theme.maintenance.inc Returns HTML for a results report of an operation run by authorize.php.
theme_book_admin_table core/modules/book/book.admin.inc Returns HTML for a book administration form.
theme_book_title_link core/modules/book/book.module Returns HTML for a link to a book title when used as a block title.
theme_breadcrumb core/includes/theme.inc Returns HTML for a breadcrumb trail.
theme_button core/includes/form.inc Returns HTML for a button form element.
theme_checkbox core/includes/form.inc Returns HTML for a checkbox form element.
theme_checkboxes core/includes/form.inc Returns HTML for a set of checkbox form elements.
theme_color_scheme_form core/modules/color/color.module Returns HTML for a theme's color form.
theme_comment_block core/modules/comment/comment.module Returns HTML for a list of recent comments to be displayed in the comment block.
theme_comment_post_forbidden core/modules/comment/comment.module Returns HTML for a "you can't post comments" notice.
theme_confirm_form core/modules/system/system.module Returns HTML for a confirmation form.
theme_container core/includes/form.inc Returns HTML to wrap child elements in a container.
theme_dashboard core/modules/dashboard/dashboard.module Returns HTML for the entire dashboard.
theme_dashboard_admin core/modules/dashboard/dashboard.module Returns HTML for the non-customizable part of the dashboard page.
theme_dashboard_disabled_block core/modules/dashboard/dashboard.module Returns HTML for disabled blocks, for use in dashboard customization mode.
theme_dashboard_disabled_blocks core/modules/dashboard/dashboard.module Returns HTML for disabled blocks, for use in dashboard customization mode.
theme_dashboard_region core/modules/dashboard/dashboard.module Returns HTML for a generic dashboard region.
theme_date core/includes/form.inc Returns HTML for a date selection form element.
theme_dblog_message core/modules/dblog/dblog.admin.inc Returns HTML for a log message.
theme_exposed_filters core/modules/system/system.module Returns HTML for an exposed filter form.
theme_feed_icon core/includes/theme.inc Returns HTML for a feed icon.
theme_field core/modules/field/field.module Returns HTML for a field.
theme_fieldset core/includes/form.inc Returns HTML for a fieldset form element and its children.
theme_field_multiple_value_form core/modules/field/field.form.inc Returns HTML for an individual form element.
theme_field_ui_table core/modules/field_ui/field_ui.admin.inc Returns HTML for Field UI overview tables.
theme_file core/includes/form.inc Returns HTML for a file upload form element.
theme_file_formatter_table core/modules/file/file.field.inc Returns HTML for a file attachments table.
theme_file_icon core/modules/file/file.module Returns HTML for an image with an appropriate icon for the given file.
theme_file_link core/modules/file/file.module Returns HTML for a link to a file.
theme_file_managed_file core/modules/file/file.module Returns HTML for a managed file element.
theme_file_upload_help core/modules/file/file.field.inc Returns HTML for help text based on file upload validators.
theme_file_widget core/modules/file/file.field.inc Returns HTML for an individual file upload widget.
theme_file_widget_multiple core/modules/file/file.field.inc Returns HTML for a group of file upload widgets.
theme_filter_admin_format_filter_order core/modules/filter/filter.admin.inc Returns HTML for a text format's filter order form.
theme_filter_admin_overview core/modules/filter/filter.admin.inc Returns HTML for the text format administration overview form.
theme_filter_guidelines core/modules/filter/filter.module Returns HTML for guidelines for a text format.
theme_filter_tips core/modules/filter/filter.pages.inc Returns HTML for a set of filter tips.
theme_filter_tips_more_info core/modules/filter/filter.module Returns HTML for a link to the more extensive filter tips.
theme_form core/includes/form.inc Returns HTML for a form.
theme_form_element core/includes/form.inc Returns HTML for a form element.
theme_form_element_label core/includes/form.inc Returns HTML for a form element label and required marker.
theme_form_required_marker core/includes/form.inc Returns HTML for a marker for required form elements.
theme_forum_form core/modules/forum/forum.admin.inc Returns HTML for a forum form.
theme_hidden core/includes/form.inc Returns HTML for a hidden form element.
theme_html_tag core/includes/theme.inc Returns HTML for a generic HTML tag with attributes.
theme_image core/includes/theme.inc Returns HTML for an image.
theme_image_anchor core/modules/image/image.admin.inc Returns HTML for a 3x3 grid of checkboxes for image anchors.
theme_image_button core/includes/form.inc Returns HTML for an image button form element.
theme_image_crop_summary core/modules/image/image.admin.inc Returns HTML for a summary of an image crop effect.
theme_image_formatter core/modules/image/image.field.inc Returns HTML for an image field formatter.
theme_image_resize_summary core/modules/image/image.admin.inc Returns HTML for a summary of an image resize effect.
theme_image_rotate_summary core/modules/image/image.admin.inc Returns HTML for a summary of an image rotate effect.
theme_image_scale_summary core/modules/image/image.admin.inc Returns HTML for a summary of an image scale effect.
theme_image_style core/modules/image/image.module Returns HTML for an image using a specific image style.
theme_image_style_effects core/modules/image/image.admin.inc Returns HTML for a listing of the effects within a specific image style.
theme_image_style_list core/modules/image/image.admin.inc Returns HTML for the page containing the list of image styles.
theme_image_style_preview core/modules/image/image.admin.inc Returns HTML for a preview of an image style.
theme_image_widget core/modules/image/image.field.inc Returns HTML for an image field widget.
theme_indentation core/includes/theme.inc Returns HTML for an indentation div; used for drag and drop tables.
theme_item_list core/includes/theme.inc Returns HTML for a list or nested list of items.
theme_link core/includes/theme.inc Returns HTML for a link.
theme_links core/includes/theme.inc Returns HTML for a set of links.
theme_locale_date_format_form core/modules/locale/locale.admin.inc Returns HTML for a locale date format form.
theme_locale_languages_configure_form core/modules/locale/locale.admin.inc Returns HTML for a language configuration form.
theme_locale_languages_overview_form core/modules/locale/locale.admin.inc Returns HTML for the language overview form.
theme_mark core/includes/theme.inc Returns HTML for a marker for new or updated content.
theme_menu_admin_overview core/modules/menu/menu.admin.inc Returns HTML for a menu title and description for the menu overview page.
theme_menu_link core/includes/menu.inc Returns HTML for a menu link and submenu.
theme_menu_local_action core/includes/menu.inc Returns HTML for a single local action link.
theme_menu_local_task core/includes/menu.inc Returns HTML for a single local task link.
theme_menu_local_tasks core/includes/menu.inc Returns HTML for primary and secondary local tasks.
theme_menu_overview_form core/modules/menu/menu.admin.inc Returns HTML for the menu overview form into a table.
theme_menu_tree core/includes/menu.inc Returns HTML for a wrapper for a menu sub-tree.
theme_more_help_link core/includes/theme.inc Returns HTML for a "more help" link.
theme_more_link core/includes/theme.inc Returns HTML for a "more" link, like those used in blocks.
theme_node_add_list core/modules/node/node.pages.inc Returns HTML for a list of available node types for node creation.
theme_node_admin_overview core/modules/node/content_types.inc Returns HTML for a node type description for the content type admin overview page.
theme_node_preview core/modules/node/node.pages.inc Returns HTML for a node preview for display during node creation and editing.
theme_node_recent_block core/modules/node/node.module Returns HTML for a list of recent content.
theme_node_recent_content core/modules/node/node.module Returns HTML for a recent node to be displayed in the recent content block.
theme_node_search_admin core/modules/node/node.module Returns HTML for the content ranking part of the search settings admin page.
theme_options_none core/modules/field/modules/options/options.module Returns HTML for the label for the empty value for options that are not required.
theme_overlay_disable_message core/modules/overlay/overlay.module Returns the HTML for the message about how to disable the overlay.
theme_pager core/includes/pager.inc Returns HTML for a query pager.
theme_pager_first core/includes/pager.inc Returns HTML for the "first page" link in a query pager.
theme_pager_last core/includes/pager.inc Returns HTML for the "last page" link in query pager.
theme_pager_link core/includes/pager.inc Returns HTML for a link to a specific query result page.
theme_pager_next core/includes/pager.inc Returns HTML for the "next page" link in a query pager.
theme_pager_previous core/includes/pager.inc Returns HTML for the "previous page" link in a query pager.
theme_password core/includes/form.inc Returns HTML for a password form element.
theme_poll_choices core/modules/poll/poll.module Returns HTML for an admin poll form for choices.
theme_profile_admin_overview core/modules/profile/profile.admin.inc Returns HTML for the profile field overview form into a drag and drop enabled table.
theme_progress_bar core/includes/theme.inc Returns HTML for a progress bar.
theme_radio core/includes/form.inc Returns HTML for a radio button form element.
theme_radios core/includes/form.inc Returns HTML for a set of radio button form elements.
theme_rdf_metadata core/modules/rdf/rdf.module Returns HTML for a series of empty spans for exporting RDF metadata in RDFa.
theme_rdf_template_variable_wrapper core/modules/rdf/rdf.module Returns HTML for a template variable wrapped in an HTML element with the RDF attributes.
theme_select core/includes/form.inc Returns HTML for a select form element.
theme_shortcut_set_customize core/modules/shortcut/shortcut.admin.inc Returns HTML for a shortcut set customization form.
theme_simpletest_result_summary core/modules/simpletest/simpletest.pages.inc Returns HTML for the summary status of a simpletest result.
theme_simpletest_test_table core/modules/simpletest/simpletest.pages.inc Returns HTML for a test list generated by simpletest_test_form() into a table.
theme_status_messages core/includes/theme.inc Returns HTML for status and/or error messages, grouped by type.
theme_status_report core/modules/system/system.admin.inc Returns HTML for the status report.
theme_submit core/includes/form.inc Returns HTML for a submit button form element.
theme_system_admin_index core/modules/system/system.admin.inc Returns HTML for the output of the dashboard page.
theme_system_compact_link core/modules/system/system.module Returns HTML for a link to show or hide inline help descriptions.
theme_system_date_time_settings core/modules/system/system.admin.inc Returns HTML for the date settings form.
theme_system_modules_fieldset core/modules/system/system.admin.inc Returns HTML for the modules form.
theme_system_modules_incompatible core/modules/system/system.admin.inc Returns HTML for a message about incompatible modules.
theme_system_modules_uninstall core/modules/system/system.admin.inc Returns HTML for a table of currently disabled modules.
theme_system_powered_by core/modules/system/system.module Returns HTML for the Powered by Drupal text.
theme_system_settings_form core/modules/system/system.module Returns HTML for a system settings form.
theme_system_themes_page core/modules/system/system.admin.inc Returns HTML for the Appearance page.
theme_table core/includes/theme.inc Returns HTML for a table.
theme_tableselect core/includes/form.inc Returns HTML for a table with radio buttons or checkboxes.
theme_tablesort_indicator core/includes/theme.inc Returns HTML for a sort icon.
theme_task_list core/includes/theme.maintenance.inc Returns HTML for a list of maintenance tasks to perform.
theme_taxonomy_overview_terms core/modules/taxonomy/taxonomy.admin.inc Returns HTML for a terms overview form as a sortable list of terms.
theme_taxonomy_overview_vocabularies core/modules/taxonomy/taxonomy.admin.inc Returns HTML for the vocabulary overview form as a sortable list of vocabularies.
theme_textarea core/includes/form.inc Returns HTML for a textarea form element.
theme_textfield core/includes/form.inc Returns HTML for a textfield form element.
theme_text_format_wrapper core/modules/filter/filter.module Returns HTML for a text format-enabled form element.
theme_trigger_display core/modules/trigger/trigger.admin.inc Returns HTML for the form showing actions assigned to a trigger.
theme_update_last_check core/modules/update/update.module Returns HTML for the last time we checked for update data.
theme_update_manager_update_form core/modules/update/update.manager.inc Returns HTML for the first page in the process of updating projects.
theme_update_report core/modules/update/update.report.inc Returns HTML for the project status report.
theme_update_status_label core/modules/update/update.report.inc Returns HTML for a label to display for a project's update status.
theme_update_version core/modules/update/update.report.inc Returns HTML for the version display of a project.
theme_username core/includes/theme.inc Returns HTML for a username, potentially linked to the user's page.
theme_user_admin_permissions core/modules/user/user.admin.inc Returns HTML for the administer permissions page.
theme_user_admin_roles core/modules/user/user.admin.inc Returns HTML for the role order and new role form.
theme_user_list core/modules/user/user.module Returns HTML for a list of users.
theme_user_permission_description core/modules/user/user.admin.inc Returns HTML for an individual permission description.
theme_user_signature core/modules/user/user.module Returns HTML for a user signature.
theme_vertical_tabs core/includes/form.inc Returns HTML for an element's children fieldsets as vertical tabs.

Files

Namesort descending Location Description
aggregator-feed-source.tpl.php core/modules/aggregator/aggregator-feed-source.tpl.php Default theme implementation to present the source of the feed.
aggregator-item.tpl.php core/modules/aggregator/aggregator-item.tpl.php Default theme implementation to format an individual feed item for display on the aggregator page.
aggregator-summary-item.tpl.php core/modules/aggregator/aggregator-summary-item.tpl.php Default theme implementation to present a linked feed item for summaries.
aggregator-summary-items.tpl.php core/modules/aggregator/aggregator-summary-items.tpl.php Default theme implementation to present feeds as list items.
aggregator-wrapper.tpl.php core/modules/aggregator/aggregator-wrapper.tpl.php Default theme implementation to wrap aggregator content.
block-admin-display-form.tpl.php core/modules/block/block-admin-display-form.tpl.php Default theme implementation to configure blocks.
block.tpl.php core/modules/block/block.tpl.php Default theme implementation to display a block.
book-all-books-block.tpl.php core/modules/book/book-all-books-block.tpl.php Default theme implementation for rendering book outlines within a block.
book-export-html.tpl.php core/modules/book/book-export-html.tpl.php Default theme implementation for printed version of book outline.
book-navigation.tpl.php core/modules/book/book-navigation.tpl.php Default theme implementation to navigate books.
book-node-export-html.tpl.php core/modules/book/book-node-export-html.tpl.php Default theme implementation for a single node in a printer-friendly outline.
comment-wrapper.tpl.php core/modules/comment/comment-wrapper.tpl.php Default theme implementation to provide an HTML container for comments.
comment.tpl.php core/modules/comment/comment.tpl.php Default theme implementation for comments.
field.tpl.php core/modules/field/theme/field.tpl.php field.tpl.php Default template implementation to display the value of a field.
forum-icon.tpl.php core/modules/forum/forum-icon.tpl.php Displays an appropriate icon for a forum post.
forum-list.tpl.php core/modules/forum/forum-list.tpl.php Displays a list of forums and containers.
forum-submitted.tpl.php core/modules/forum/forum-submitted.tpl.php Formats a forum post submission string.
forum-topic-list.tpl.php core/modules/forum/forum-topic-list.tpl.php Displays a list of forum topics.
forums.tpl.php core/modules/forum/forums.tpl.php Displays a forum.
html.tpl.php core/modules/system/html.tpl.php Default theme implementation to display the basic html structure of a single Drupal page.
maintenance-page.tpl.php core/modules/system/maintenance-page.tpl.php Default theme implementation to display a single Drupal page while offline.
node.tpl.php core/modules/node/node.tpl.php Default theme implementation to display a node.
overlay.tpl.php core/modules/overlay/overlay.tpl.php Default theme implementation to display a page in the overlay.
page.tpl.php core/modules/system/page.tpl.php Default theme implementation to display a single Drupal page.
poll-results.tpl.php core/modules/poll/poll-results.tpl.php Default theme implementation to display the poll results in a block.
poll-vote.tpl.php core/modules/poll/poll-vote.tpl.php Default theme implementation to display voting form for a poll.
region.tpl.php core/modules/system/region.tpl.php Default theme implementation to display a region.
search-result.tpl.php core/modules/search/search-result.tpl.php Default theme implementation for displaying a single search result.
search-results.tpl.php core/modules/search/search-results.tpl.php Default theme implementation for displaying search results.
taxonomy-term.tpl.php core/modules/taxonomy/taxonomy-term.tpl.php Default theme implementation to display a term.
toolbar.tpl.php core/modules/toolbar/toolbar.tpl.php Default template for admin toolbar.
user-picture.tpl.php core/modules/user/user-picture.tpl.php Default theme implementation to present a picture configured for the user's account.
user-profile.tpl.php core/modules/user/user-profile.tpl.php Default theme implementation to present all user profile data.