Namespace: theme

Drupal. theme

Generates the themed representation of a Drupal object.

All requests for themed output must go through this function. It examines the request and routes it to the appropriate theme function. If the current theme does not provide an override function, the generic theme function is called.

Example

To retrieve the HTML for text that should be emphasized and displayed as a placeholder inside a sentence.

Drupal.theme('placeholder', text);

Methods

staticDrupal.theme.ckeditorButtonGroupNameForm(){string}

Themes a form for changing the title of a CKEditor button group.

Returns:
Type Description
string A HTML string for the form for the title of a CKEditor button group.

staticDrupal.theme.ckeditorButtonGroupNamesToggle(){string}

Themes a button that will toggle the button group names in active config.

Returns:
Type Description
string A HTML string for the button to toggle group names.

staticDrupal.theme.ckeditorNewButtonGroup(){string}

Themes a button that will prompt the user to name a new button group.

Returns:
Type Description
string A HTML string for the button to create a name for a new button group.

staticDrupal.theme.ckeditorRow(){string}

Themes a blank CKEditor row.

Returns:
Type Description
string A HTML string for a CKEditor row.

staticDrupal.theme.ckeditorToolbarGroup(){string}

Themes a blank CKEditor button group.

Returns:
Type Description
string A HTML string for a CKEditor button group.

staticDrupal.theme.contextualTrigger(){string}

A trigger is an interactive element often bound to a click handler.

Returns:
Type Description
string A string representing a DOM fragment.

staticDrupal.theme.dropbuttonToggle(options){string}

A toggle is an interactive element often bound to a click handler.

Name Type Description
options object

Options object.

Name Type Description
title string optional

The HTML anchor title attribute and text for the inner span element.

Returns:
Type Description
string A string representing a DOM fragment.

staticDrupal.theme.filterFilterHTMLUpdateMessage(tags){string}

Theme function for the filter_html update message.

Name Type Description
tags Array

An array of the new tags that are to be allowed.

Returns:
Type Description
string The corresponding HTML.

staticDrupal.theme.localeTranslateChangedMarker(){string}

Creates markup for a changed translation marker.

Returns:
Type Description
string Markup for the marker.

staticDrupal.theme.localeTranslateChangedWarning(){string}

Creates markup for the translation changed warning.

Returns:
Type Description
string Markup for the warning.

staticDrupal.theme.nodePreviewModal(){string}

Theme function for node preview modal.

Returns:
Type Description
string Markup for the node preview modal.

staticDrupal.theme.placeholder(str){string}

Formats text for emphasized display in a placeholder inside a sentence.

Name Type Description
str string

The text to format (plain-text).

Returns:
Type Description
string The formatted text (html).

staticDrupal.theme.progressBar(id){string}

Theme function for the progress bar.

Name Type Description
id string

The id for the progress bar.

Returns:
Type Description
string The HTML for the progress bar.

staticDrupal.theme.quickeditBackstage(settings){string}

Theme function for a "backstage" for the Quick Edit module.

Name Type Description
settings object

Settings object used to construct the markup.

Name Type Description
id string

The id to apply to the backstage.

Returns:
Type Description
string The corresponding HTML.

staticDrupal.theme.quickeditButtons(settings){string}

Theme function for buttons of the Quick Edit module.

Can be used for the buttons both in the toolbar toolgroups and in the modal.

Name Type Description
settings object

Settings object used to construct the markup.

Name Type Description
buttons Array
  • String type: the type of the button (defaults to 'button')
  • Array classes: the classes of the button.
  • String label: the label of the button.
Returns:
Type Description
string The corresponding HTML.

staticDrupal.theme.quickeditEntityToolbar(settings){string}

Theme function for a toolbar container of the Quick Edit module.

Name Type Description
settings object

Settings object used to construct the markup.

Name Type Description
id string

the id to apply to the backstage.

Returns:
Type Description
string The corresponding HTML.

staticDrupal.theme.quickeditEntityToolbarFence(){string}

Element defining a containing box for the placement of the entity toolbar.

Returns:
Type Description
string The corresponding HTML.

staticDrupal.theme.quickeditEntityToolbarLabel(settings){string}

Theme function for a toolbar container of the Quick Edit module.

Name Type Description
settings object

Settings object used to construct the markup.

Name Type Description
entityLabel string

The title of the active entity.

fieldLabel string

The label of the highlighted or active field.

Returns:
Type Description
string The corresponding HTML.

staticDrupal.theme.quickeditFieldToolbar(settings){string}

Theme function for a toolbar container of the Quick Edit module.

Name Type Description
settings object

Settings object used to construct the markup.

Name Type Description
id string

The id to apply to the toolbar container.

Returns:
Type Description
string The corresponding HTML.

staticDrupal.theme.quickeditFormContainer(settings){string}

Theme function for a form container of the Quick Edit module.

Name Type Description
settings object

Settings object used to construct the markup.

Name Type Description
id string

The id to apply to the toolbar container.

loadingMsg string

The message to show while loading.

Returns:
Type Description
string The corresponding HTML.

staticDrupal.theme.quickeditToolgroup(settings){string}

Theme function for a toolbar toolgroup of the Quick Edit module.

Name Type Description
settings object

Settings object used to construct the markup.

Name Type Description
id string optional

The id of the toolgroup.

classes string

The class of the toolgroup.

buttons Array

See Drupal.theme.quickeditButtons.

Returns:
Type Description
string The corresponding HTML.

staticDrupal.theme.tableDragChangedMarker(){string}

Returns:
Type Description
string Markup for the marker.

staticDrupal.theme.tableDragChangedWarning(){string}

Returns:
Type Description
string Markup for the warning.

staticDrupal.theme.tableDragChangedWarning(){Array}

Get rid of irritating tabledrag messages.

Returns:
Type Description
Array An array of messages. Always empty array, to get rid of the messages.

staticDrupal.theme.tableDragIndentation(){string}

Returns:
Type Description
string Markup for the indentation.

staticDrupal.theme.toolbarMenuItemToggle(options){string}

A toggle is an interactive element often bound to a click handler.

Name Type Description
options object

Options for the button.

Name Type Description
class string

Class to set on the button.

action string

Action for the button.

text string

Used as label for the button.

Returns:
Type Description
string A string representing a DOM fragment.

staticDrupal.theme.toolbarOrientationToggle(){string}

A toggle is an interactive element often bound to a click handler.

Returns:
Type Description
string A string representing a DOM fragment.

staticDrupal.theme.verticalTab(settings){object}

Theme function for a vertical tab.

Name Type Description
settings object

An object with the following keys:

Name Type Description
title string

The name of the tab.

Returns:
Type Description
object This function has to return an object with at least these keys:
  • item: The root tab jQuery element
  • link: The anchor tag that acts as the clickable area of the tab (jQuery version)
  • summary: The jQuery element that contains the tab summary