Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Apress.Pro.Drupal.7.Development.3rd.Edition.Dec.2010.pdf
Скачиваний:
73
Добавлен:
14.03.2016
Размер:
12.64 Mб
Скачать

CHAPTER 9 THE THEME SYSTEM

template_preprocess() template_preprocess_breadcrumb() crumbpicker_preprocess() crumbpicker_preprocess_breadcrumb() phptemplate_preprocess() phptemplate_preprocess_breadcrumb() grayscale_preprocess() grayscale_preprocess_breadcrumb() template_process()

Thus grayscale_preprocess_breadcrumb() can override any variable that has been set; it’s called last before the variables are handed to the template file. Calling all those functions when only some of them are implemented may seem to you like a waste of time. If so, you are correct, and when the theme registry is built, Drupal determines which functions are implemented and calls only those.

Using the Theme Developer Module

An invaluable resource for working with Drupal themes is the theme developer module. It is part of devel.module and can be downloaded at http://drupal.org/project/devel_themer. The theme developer module lets you point to an element on a page and discover which templates or theme functions were involved in creating that element as well as the variables (and their values) available to that element.

Summary

After reading this chapter, you should be able to

Create template files.

Override theme functions.

Manipulate template variables.

Create new page regions for blocks.

For additional details about theming in Drupal 7, please check the theme handbook page at http://drupal.org/documentation/theme.

221

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]