Default theme implementations in Drupal 6
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Render/theme.api.php \themeable
- 4 includes/theme.inc \themeable
- 5 includes/theme.inc \themeable
- 7 modules/system/theme.api.php \themeable
- 9 core/lib/Drupal/Core/Render/theme.api.php \themeable
Functions and templates that present output to the user, and can 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 several arguments. For example, theme('table', $header, $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'), $header, $rows) 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 either phptemplate_HOOK or THEMENAME_HOOK. For example, for Drupal's default theme (Garland) to implement the 'table' hook, the phptemplate.engine would find phptemplate_table() or garland_table(). The ENGINE_HOOK() syntax is preferred, as this can be used by sub-themes (which are themes that share code but use different stylesheets).
The theme system is described and defined in theme.inc.
See also
theme()
hook_theme()
File
- includes/
theme.inc, line 1085 - The theme system, which controls the output of Drupal.
Functions
Name | Location | Description |
---|---|---|
phptemplate_menu_local_tasks |
themes/ |
Returns the rendered local tasks. The default implementation renders them as tabs. Overridden to split the secondary tasks. |
theme_admin_block |
modules/ |
This function formats an administrative block for display. |
theme_admin_block_content |
modules/ |
This function formats the content of an administrative block. |
theme_admin_page |
modules/ |
This function formats an administrative page for viewing. |
theme_aggregator_block_item |
modules/ |
Format an individual feed item for display in the block. |
theme_aggregator_categorize_items |
modules/ |
Theme the page list form for assigning categories. |
theme_aggregator_page_opml |
modules/ |
Theme the OPML feed output. |
theme_aggregator_page_rss |
modules/ |
Theme the RSS output. |
theme_blocks |
includes/ |
Return a set of blocks available for the current user. |
theme_book_admin_table |
modules/ |
Theme function for the book administration page form. |
theme_book_title_link |
modules/ |
Generate the HTML output for a link to a book title when used as a block title. |
theme_box |
includes/ |
Return a themed box. |
theme_breadcrumb |
includes/ |
Return a themed breadcrumb trail. |
theme_button |
includes/ |
Theme a form button. |
theme_checkbox |
includes/ |
Format a checkbox. |
theme_checkboxes |
includes/ |
Format a set of checkboxes. |
theme_closure |
includes/ |
Execute hook_footer() which is run at the end of the page right before the close of the body tag. |
theme_color_scheme_form |
modules/ |
Theme color form. |
theme_comment_admin_overview |
modules/ |
Theme the comment admin form. |
theme_comment_block |
modules/ |
Returns a formatted list of recent comments to be displayed in the comment block. |
theme_comment_controls |
modules/ |
Theme comment controls box where the user can change the default display mode and display order of comments. |
theme_comment_flat_collapsed |
modules/ |
Theme comment flat collapsed view. |
theme_comment_flat_expanded |
modules/ |
Theme comment flat expanded view. |
theme_comment_post_forbidden |
modules/ |
Theme a "you can't post comments" notice. |
theme_comment_submitted |
modules/ |
Theme a "Submitted by ..." notice. |
theme_comment_thread_collapsed |
modules/ |
Theme comment thread collapsed view. |
theme_comment_thread_expanded |
modules/ |
Theme comment thread expanded view. |
theme_comment_view |
modules/ |
Themes a single comment and related items. |
theme_date |
includes/ |
Format a date selection element. |
theme_dblog_filters |
modules/ |
Theme dblog administration filter selector. |
theme_feed_icon |
includes/ |
Return code that emits an feed icon. |
theme_fieldset |
includes/ |
Format a group of form items. |
theme_file |
includes/ |
Format a file upload field. |
theme_filter_admin_order |
modules/ |
Theme filter order configuration form. |
theme_filter_admin_overview |
modules/ |
Theme the admin overview form. |
theme_filter_tips |
modules/ |
Format a set of filter tips. |
theme_filter_tips_more_info |
modules/ |
Format a link to the more extensive filter tips. |
theme_form |
includes/ |
Format a form. |
theme_form_element |
includes/ |
Return a themed form element. |
theme_help |
includes/ |
Return a themed help message. |
theme_hidden |
includes/ |
Format a hidden form field. |
theme_image |
includes/ |
Return a themed image. |
theme_image_button |
includes/ |
Theme a form image button. |
theme_indentation |
includes/ |
Create a standard indentation div. Used for drag and drop tables. |
theme_item |
includes/ |
Format a form item. |
theme_item_list |
includes/ |
Return a themed list of items. |
theme_links |
includes/ |
Returns HTML for a set of links. |
theme_locale_languages_overview_form |
includes/ |
Theme the language overview form. |
theme_mark |
includes/ |
Return a themed marker, useful for marking new or updated content. |
theme_markup |
includes/ |
Format HTML markup for use in forms. |
theme_menu_item |
includes/ |
Generate the HTML output for a menu item and submenu. |
theme_menu_item_link |
includes/ |
Generate the HTML output for a single menu link. |
theme_menu_local_task |
includes/ |
Generate the HTML output for a single local task link. |
theme_menu_local_tasks |
includes/ |
Returns the rendered local tasks. The default implementation renders them as tabs. |
theme_menu_overview_form |
modules/ |
Theme the menu overview form into a table. |
theme_menu_tree |
includes/ |
Generate the HTML output for a menu tree |
theme_more_help_link |
includes/ |
Returns code that emits the 'more help'-link. |
theme_more_link |
includes/ |
Returns code that emits the 'more' link used on blocks. |
theme_node_add_list |
modules/ |
Display the list of available node types for node creation. |
theme_node_admin_nodes |
modules/ |
Theme node administration overview. |
theme_node_filters |
modules/ |
Theme node administration filter selector. |
theme_node_filter_form |
modules/ |
Theme node administration filter form. |
theme_node_form |
modules/ |
Present a node submission form. |
theme_node_list |
modules/ |
Format a listing of links to nodes. |
theme_node_log_message |
modules/ |
Theme a log message. |
theme_node_preview |
modules/ |
Display a node preview for display during node creation and editing. |
theme_node_search_admin |
modules/ |
Theme the content ranking part of the search settings admin page. |
theme_node_submitted |
modules/ |
Format the "Submitted by username on date/time" for each node |
theme_pager |
includes/ |
Returns HTML for a query pager. |
theme_pager_first |
includes/ |
Returns HTML for a "first page" link. |
theme_pager_last |
includes/ |
Returns HTML for a "last page" link. |
theme_pager_link |
includes/ |
Returns HTML for a link to a specific query result page. |
theme_pager_next |
includes/ |
Returns HTML for a "next page" link. |
theme_pager_previous |
includes/ |
Returns HTML for a "previous page" link. |
theme_password |
includes/ |
Format a password field. |
theme_password_confirm |
includes/ |
Format a password_confirm item. |
theme_placeholder |
includes/ |
Formats text for emphasized display in a placeholder inside a sentence. Used automatically by t(). |
theme_poll_choices |
modules/ |
Theme the admin poll form for choices. |
theme_profile_admin_overview |
modules/ |
Theme the profile field overview into a drag and drop enabled table. |
theme_progress_bar |
includes/ |
Return a themed progress bar. |
theme_radio |
includes/ |
Format a radio button. |
theme_radios |
includes/ |
Format a set of radio buttons. |
theme_select |
includes/ |
Format a dropdown menu or scrolling selection box. |
theme_status_messages |
includes/ |
Return a themed set of status and/or error messages. The messages are grouped by type. |
theme_status_report |
modules/ |
Theme requirements status report. |
theme_submenu |
includes/ |
Return a themed submenu, typically displayed under the tabs. |
theme_submit |
includes/ |
Theme a form submit button. |
theme_syslog_format |
modules/ |
Format a system log entry. |
theme_system_admin_by_module |
modules/ |
Theme output of the dashboard page. |
theme_system_modules |
modules/ |
Theme callback for the modules form. |
theme_system_modules_uninstall |
modules/ |
Themes a table of currently disabled modules. |
theme_system_powered_by |
modules/ |
Format the Powered by Drupal text. |
theme_system_themes_form |
modules/ |
Theme function for the system themes form. |
theme_system_theme_select_form |
modules/ |
Theme the theme select form. |
theme_table |
includes/ |
Return a themed table. |
theme_tablesort_indicator |
includes/ |
Return a themed sort icon. |
theme_table_select_header_cell |
includes/ |
Returns a header cell for tables that have a select all functionality. |
theme_task_list |
includes/ |
Return a themed list of maintenance tasks to perform. |
theme_taxonomy_overview_terms |
modules/ |
Theme the terms overview as a sortable list of terms. |
theme_taxonomy_overview_vocabularies |
modules/ |
Theme the vocabulary overview as a sortable list of vocabularies. |
theme_taxonomy_term_page |
modules/ |
Render a taxonomy term page HTML output. |
theme_taxonomy_term_select |
modules/ |
Format the selection field for choosing terms (by deafult the default selection field is used). |
theme_textarea |
includes/ |
Format a textarea. |
theme_textfield |
includes/ |
Format a textfield. |
theme_token |
includes/ |
Format a form token. |
theme_trigger_display |
modules/ |
Display actions assigned to this hook-op combination in a table. |
theme_update_report |
modules/ |
Theme project status report. |
theme_update_version |
modules/ |
Theme the version display of a project. |
theme_upload_attachments |
modules/ |
Displays file attachments in table |
theme_upload_form_current |
modules/ |
Theme the attachments list. |
theme_upload_form_new |
modules/ |
Theme the attachment form. Note: required to output prefix/suffix. |
theme_username |
includes/ |
Format a username. |
theme_user_admin_account |
modules/ |
Theme user administration overview. |
theme_user_admin_new_role |
modules/ |
Theme the new-role form. |
theme_user_admin_perm |
modules/ |
Theme the administer permissions page. |
theme_user_filters |
modules/ |
Theme user administration filter selector. |
theme_user_filter_form |
modules/ |
Theme user administration filter form. |
theme_user_list |
modules/ |
Make a list of users. |
theme_user_signature |
modules/ |
Theme output of user signature. |
theme_xml_icon |
includes/ |
Return code that emits an XML icon. |
_theme_table_cell |
includes/ |
End of "defgroup themeable". |