Functions and templates for the user interface to be implemented by themes.
Backdrop's presentation layer is a pluggable system known as the theme layer. Each theme can take control over most of Backdrop's output, and has complete control over the CSS.
Inside Backdrop, 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.
Every theme hook is required to be registered by the module that owns it, so that Backdrop 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.
Backdrop's default template renderer is a simple PHP parsing engine that includes the template and stores the output. Backdrop's theme engines can provide alternate template engines, such as XTemplate, Smarty and PHPTal. The most common template engine is PHPTemplate (included with Backdrop and implemented in phptemplate.engine, which uses Backdrop'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 Backdrop what it is implementing; themes utilizing an engine will have their well-named theme 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 Backdrop'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()
File
- core/
modules/ system/ theme.api.php, line 3
Functions
Name | Location | Description |
---|---|---|
date_preprocess_views_view |
core/ |
Implements template_preprocess_views_view(). |
template_preprocess_datetime |
core/ |
Preprocess variables for theme_datetime(). |
template_preprocess_date_views_filter_form |
core/ |
Preprocessor for Date Views filter form. |
template_preprocess_date_views_pager |
core/ |
Preprocess function for Date pager template. |
template_preprocess_image |
core/ |
Preprocess variables for theme_image(). |
theme_admin_block |
core/ |
Returns HTML for an administrative block for display. |
theme_admin_block_content |
core/ |
Returns HTML for the content of an administrative block. |
theme_admin_page |
core/ |
Returns HTML for an administrative page. |
theme_authorize_message |
core/ |
Returns HTML for a single log message from the authorize.php batch operation. |
theme_authorize_report |
core/ |
Returns HTML for a results report of an operation run by authorize.php. |
theme_book_admin_table |
core/ |
Returns HTML for a book administration form. |
theme_breadcrumb |
core/ |
Returns HTML for a breadcrumb trail. |
theme_button |
core/ |
Returns HTML for a button form element. |
theme_checkbox |
core/ |
Returns HTML for a checkbox form element. |
theme_color |
core/ |
Returns HTML for a color form element. |
theme_color_preview |
core/ |
Returns HTML for a theme's color preview. |
theme_comment_block |
core/ |
Returns HTML for a list of recent comments. |
theme_comment_post_forbidden |
core/ |
Returns HTML for a "you can't post comments" notice. |
theme_confirm_form |
core/ |
Returns HTML for a confirmation form. |
theme_contact_category_list_table |
core/ |
Returns HTML for the contact form categories administrative table. |
theme_container |
core/ |
Returns HTML to wrap child elements in a container. |
theme_date |
core/ |
Returns HTML for a date selection form element. |
theme_datetime |
core/ |
Returns HTML for a date / time. |
theme_date_combo |
core/ |
Returns HTML for a start/end date combination on form. |
theme_date_display_combination |
core/ |
Returns HTML for a date element formatted as a Start/End combination. |
theme_date_display_interval |
core/ |
Returns HTML for a date element formatted as an interval. |
theme_date_display_range |
core/ |
Returns HTML for a date element formatted as a range. |
theme_date_display_remaining |
core/ |
Returns HTML for remaining message. |
theme_date_display_single |
core/ |
Returns HTML for a date element formatted as a single date. |
theme_date_nav_title |
core/ |
Theme the calendar title. |
theme_date_popup |
core/ |
Format a date popup element. |
theme_date_select |
core/ |
Returns HTML for a "date_select" element, including all child elements. |
theme_date_select_element |
core/ |
Returns HTML for a date select input form element. |
theme_date_text |
core/ |
Returns HTML for a date text element. |
theme_date_textfield_element |
core/ |
Returns HTML for a date textfield input form element. |
theme_date_text_parts |
core/ |
Returns HTML for the text/select options for date parts in a table. |
theme_date_timezone |
core/ |
Returns HTML for a date timezone element. |
theme_date_time_ago |
core/ |
Returns HTML for a date in the format 'time ago'. |
theme_details |
core/ |
Returns HTML to wrap children in a details element. |
theme_dropbutton_wrapper |
core/ |
Provide wrapper HTML around dropbutton lists. |
theme_email |
core/ |
Returns HTML for an email form element. |
theme_exposed_filters |
core/ |
Returns HTML for an exposed filter form. |
theme_feed_icon |
core/ |
Returns HTML for a feed icon. |
theme_field |
core/ |
Returns HTML for a field. |
theme_fieldset |
core/ |
Returns HTML for a fieldset form element and its children. |
theme_field_multiple_value_form |
core/ |
Returns HTML for an individual form element. |
theme_field_ui_table |
core/ |
Returns HTML for Field UI overview tables. |
theme_field_ui_view_modes |
core/ |
Returns HTML for the entity display mode table. |
theme_file |
core/ |
Returns HTML for a file upload form element. |
theme_file_audio |
core/ |
Returns HTML for displaying an HTML5 <audio> tag. |
theme_file_formatter_table |
core/ |
Returns HTML for a file attachments table. |
theme_file_icon |
core/ |
Returns HTML for an image with an appropriate icon for the given file. |
theme_file_link |
core/ |
Returns HTML for a link to a file. |
theme_file_managed_file |
core/ |
Returns HTML for a managed file element. |
theme_file_upload_help |
core/ |
Returns HTML for help text based on file upload validators. |
theme_file_video |
core/ |
Returns HTML for displaying an HTML5 <video> tag. |
theme_file_widget |
core/ |
Returns HTML for an individual file upload widget. |
theme_file_widget_multiple |
core/ |
Returns HTML for a group of file upload widgets. |
theme_filter_admin_format_filter_order |
core/ |
Returns HTML for a text format's filter order form. |
theme_filter_admin_overview |
core/ |
Returns HTML for the text format administration overview form. |
theme_filter_guidelines |
core/ |
Returns HTML for guidelines for a text format. |
theme_filter_tips |
core/ |
Returns HTML for a set of filter tips. |
theme_filter_tips_more_info |
core/ |
Returns HTML for a link to the more extensive filter tips. |
theme_form |
core/ |
Returns HTML for a form. |
theme_form_element |
core/ |
Returns HTML for a form element. |
theme_form_element_description |
core/ |
Returns HTML for a form element's help text (#description). |
theme_form_element_label |
core/ |
Returns HTML for a form element label and required marker. |
theme_form_required_marker |
core/ |
Returns HTML for a marker for required form elements. |
theme_head_tag |
core/ |
Returns HTML for a generic HTML tag with attributes. |
theme_help |
core/ |
Returns HTML for a help element. |
theme_hidden |
core/ |
Returns HTML for a hidden form element. |
theme_image |
core/ |
Returns HTML for an image. |
theme_image_anchor |
core/ |
Returns HTML for a 3x3 grid of checkboxes for image anchors. |
theme_image_button |
core/ |
Returns HTML for an image button form element. |
theme_image_crop_summary |
core/ |
Returns HTML for a summary of an image crop effect. |
theme_image_formatter |
core/ |
Returns HTML for an image field formatter. |
theme_image_resize_summary |
core/ |
Returns HTML for a summary of an image resize effect. |
theme_image_rotate_summary |
core/ |
Returns HTML for a summary of an image rotate effect. |
theme_image_scale_summary |
core/ |
Returns HTML for a summary of an image scale effect. |
theme_image_style |
core/ |
Returns HTML for an image using a specific image style. |
theme_image_style_effects |
core/ |
Returns HTML for a listing of the effects within a specific image style. |
theme_image_style_list |
core/ |
Returns HTML for the page containing the list of image styles. |
theme_image_style_preview |
core/ |
Returns HTML for a preview of an image style. |
theme_image_widget |
core/ |
Returns HTML for an image field widget. |
theme_indentation |
core/ |
Returns HTML for an indentation div. Used for drag and drop tables. |
theme_item_list |
core/ |
Returns HTML for a list or nested list of items. |
theme_label_machine_name |
core/ |
Returns HTML for the display of a label and its machine name. |
theme_language_admin_overview_form_table |
core/ |
Returns HTML for the language overview form. |
theme_language_negotiation_configure_form |
core/ |
Returns HTML for the language negotiation configuration form. |
theme_link |
core/ |
Returns HTML for a link. |
theme_links |
core/ |
Returns HTML for a set of links. |
theme_locale_date_format_form |
core/ |
Returns themed HTML for the locale_date_format_form() form. |
theme_mark |
core/ |
Returns HTML for a marker for new or updated content. |
theme_menu_admin_overview Deprecated |
core/ |
Returns HTML for a menu title and description for the menu overview page. |
theme_menu_link |
core/ |
Returns HTML for a menu link and submenu. |
theme_menu_local_action |
core/ |
Returns HTML for a single local action link. |
theme_menu_local_actions |
core/ |
Returns rendered HTML for the local actions. |
theme_menu_local_task |
core/ |
Returns HTML for a single local task link. |
theme_menu_local_tasks |
core/ |
Returns HTML for primary and secondary local tasks. |
theme_menu_overview_form |
core/ |
Returns HTML for the menu overview form into a table. |
theme_menu_toggle |
core/ |
Returns rendered HTML for a menu toggle. |
theme_menu_tree |
core/ |
Returns HTML for a wrapper for a menu tree. |
theme_more_help_link |
core/ |
Returns HTML for a "more help" link. |
theme_more_link |
core/ |
Returns HTML for a "more" link, like those used in blocks. |
theme_node_add_list |
core/ |
Returns HTML for a list of available node types for node creation. |
theme_node_admin_overview Deprecated |
core/ |
Returns HTML for a node type description for the content type admin page. |
theme_node_preview |
core/ |
Returns HTML for a node preview for display during node creation and editing. |
theme_node_preview_banner_form |
core/ |
Returns HTML for node_preview_banner_form(). |
theme_node_search_factors |
core/ |
Returns HTML for the content ranking part of the search settings admin page. |
theme_number |
core/ |
Returns HTML for a number form element. |
theme_options_none |
core/ |
Returns HTML for the label for the empty value for options that are not required. |
theme_pager |
core/ |
Returns HTML for a query pager. |
theme_pager_first |
core/ |
Returns HTML for the "first page" link in a query pager. |
theme_pager_last |
core/ |
Returns HTML for the "last page" link in query pager. |
theme_pager_link |
core/ |
Returns HTML for a link to a specific query result page. |
theme_pager_next |
core/ |
Returns HTML for the "next page" link in a query pager. |
theme_pager_previous |
core/ |
Returns HTML for the "previous page" link in a query pager. |
theme_password |
core/ |
Returns HTML for a password form element. |
theme_path_bulk_update_form |
core/ |
Returns HTML for the Path bulk update page. |
theme_progress_bar |
core/ |
Returns HTML for a progress bar. |
theme_radio |
core/ |
Returns HTML for a radio button form element. |
theme_range |
core/ |
Returns HTML for a range form element. |
theme_search |
core/ |
Returns HTML for a search form element. |
theme_select |
core/ |
Returns HTML for a select form element. |
theme_simpletest_result_summary |
core/ |
Returns HTML for the summary status of a simpletest result. |
theme_simpletest_test_table |
core/ |
Returns HTML for a test list generated by simpletest_test_form() into a table. |
theme_status_messages |
core/ |
Returns HTML for status and/or error messages, grouped by type. |
theme_status_report |
core/ |
Returns HTML for the status report. |
theme_submit |
core/ |
Returns HTML for a submit button form element. |
theme_system_admin_index |
core/ |
Returns HTML for the output of the dashboard page. |
theme_system_modules_fieldset |
core/ |
Returns HTML for the modules form. |
theme_system_modules_incompatible |
core/ |
Returns HTML for a message about incompatible modules. |
theme_system_modules_uninstall |
core/ |
Returns HTML for a table of currently disabled modules. |
theme_system_powered_by |
core/ |
Returns HTML for the Powered by Backdrop text. |
theme_system_settings_form |
core/ |
Returns HTML for a system settings form. |
theme_system_themes_page |
core/ |
Returns HTML for the Appearance page. |
theme_table |
core/ |
Returns HTML for a table. |
theme_tableselect |
core/ |
Returns HTML for a table with radio buttons or checkboxes. |
theme_tablesort_indicator |
core/ |
Returns HTML for a sort icon. |
theme_task_list |
core/ |
Returns HTML for a list of maintenance tasks to perform. |
theme_taxonomy_overview_terms |
core/ |
Returns HTML for a terms overview form as a sortable list of terms. |
theme_taxonomy_vocabulary_description |
core/ |
Returns HTML for the vocabulary description. |
theme_taxonomy_vocabulary_name |
core/ |
Returns HTML for the vocabulary human readable name, and its machine name. |
theme_tel |
core/ |
Returns HTML for a tel form element. |
theme_textarea |
core/ |
Returns HTML for a textarea form element. |
theme_textfield |
core/ |
Returns HTML for a textfield form element. |
theme_text_format_wrapper |
core/ |
Returns HTML for a text format-enabled form element. |
theme_token_tree |
core/ |
Provide a 'tree' display of nested tokens. |
theme_update_last_check |
core/ |
Returns HTML for the last time we checked for update data. |
theme_update_manager_update_form |
core/ |
Returns HTML for the first page in the process of updating projects. |
theme_update_report |
core/ |
Returns HTML for the project status report. |
theme_update_status_label |
core/ |
Returns HTML for a label to display for a project's update status. |
theme_update_version |
core/ |
Returns HTML for the version display of a project. |
theme_url |
core/ |
Returns HTML for a URL form element. |
theme_user_admin_permissions |
core/ |
Returns HTML for the administer permissions page. |
theme_user_admin_roles |
core/ |
Returns HTML for the role order form. |
theme_user_list |
core/ |
Returns HTML for a list of users. |
theme_user_permission_description |
core/ |
Returns HTML for an individual permission description. |
theme_user_signature |
core/ |
Returns HTML for a user signature. |
theme_vertical_tabs |
core/ |
Returns HTML for an element's children fieldsets as vertical tabs. |
Files
Name | Location | Description |
---|---|---|
book-all-books-block.tpl.php |
core/ |
Default theme implementation for rendering book outlines within a block. |
book-navigation.tpl.php |
core/ |
Default theme implementation to navigate books. |
comment.tpl.php |
core/ |
Default theme implementation for comments. |
field.tpl.php |
core/ |
field.tpl.php Default template implementation to display the value of a field. |
file.tpl.php |
core/ |
Default theme implementation to display a file. |
maintenance-page.tpl.php |
core/ |
Default theme implementation to display a single Backdrop page while offline. |
node.tpl.php |
core/ |
Default theme implementation to display a node. |
page.tpl.php |
core/ |
Default theme implementation to display the basic html structure of a single Backdrop page. |
search-results.tpl.php |
core/ |
Default theme implementation for displaying search results. |
taxonomy-term.tpl.php |
core/ |
Default theme implementation to display a term. |
user-picture.tpl.php |
core/ |
Default theme implementation to present a picture configured for the user's account. |
user-profile.tpl.php |
core/ |
Default theme implementation to present all user profile data. |