Variables Available in pagetplphp

In additional to the basic variables included in the example page .tpl. php file we built earlier in this chapter, there are a number of other variables that are available for your use:

Variable

Function

$base path

The base URL path of the Drupal installation.

$breadcrumb

HTML for displaying the breadcrumb trail.

$closure

Placed at bottom of page to provide closure for

any dynamic JavaScripts that need to be called

once the page has been displayed.

$content

The HTML content generated by Drupal.

$css

An array of all the CSS files for the page.

$directory

The relative path to the directory in which the

theme is located.

Variable

Function

$feed_icons $footer_message

$head

$head title

$help $is_front

$language $layout

$logo $messages $mission $node

$primary_links (array)

$scripts $search_box $secondary_links (array)

$sidebar_left

$sidebar_right

$site_name

$site_slogan

$styles

$tabs

$title

The links to the RSS feeds for the page.

The footer, including the footer message set by the admin.

The HTML that will appear inside the <head></head> tags.

The text displayed in the page title (between the <title> and </title> tags).

The dynamic help text.

True if the front page is currently displayed, false if not.

The site's language setting.

Set different types of layout, depending on how many sidebars are enabled (values include none, left, right,both).

Sets path to logo image (as defined in admin).

HTML for status and error messages.

The text of the site mission, as defined in admin.

Available when displaying a node in full page view.

An array containing the links designated as primary by admin.

Loads the <script> tags into the page. The HTML for the theme search box. An array containing the links designated as secondary by the admin.

The HTML for the left sidebar Region. The HTML for the right sidebar Region. The site name, as defined by admin. The site slogan, as defined by admin.

Includes the style sheets.

HTML for displaying the tabs.

The main content title, typically the node title.

A list of both current and superseded variables available for the page template is maintained on the official Drupal site at

http://drupal.org/node/11812.

Was this article helpful?

0 0

Post a comment