Each of the default tpl.php files represents an override to a themable function from the Drupal core.
theme_page, theme_node, theme_comment, theme_box, and theme_block are the common themable functions, and so have direct impact on the appearance of your site, but they are not the only functions available for modification. Core Drupal includes lot more themable functions.
However, finding themable functions, at the most basic level, is easy. You just need to search for function theme_. Everything that turns up is a themable function and can be overridden.
The most important part been how do you know which themable function is responsible for a given widget or element in your Drupal site? Drupal doesn’t have any easy built-in method for doing this. However, there is an easy way to fix this, and doing so gives you a good opportunity to peer further into the world of Drupal theming.
To do this, you just need to wrap the output from each call
to a themable function in HTML comments like this:
<!-- BEGIN: theme_foo -->
result of the themable function
<!-- END: theme_foo -->
This way, you can have a look at the source code of a generated page and know exactly which themable function to override in order to change the output.
- Kiran's blog
- 640 reads













Post new comment