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:



$base path

The base URL path of the Drupal installation.


HTML for displaying the breadcrumb trail.


Placed at bottom of page to provide closure for

any dynamic JavaScripts that need to be called

once the page has been displayed.


The HTML content generated by Drupal.


An array of all the CSS files for the page.


The relative path to the directory in which the

theme is located.



$feed_icons $footer_message


$head title

$help $is_front

$language $layout

$logo $messages $mission $node

$primary_links (array)

$scripts $search_box $secondary_links (array)








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

Was this article helpful?

0 0

Post a comment