To Know which themable function to override in Drupal

0
Your rating: None

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.

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.

Cumulus Tag Cloud

Kiran Says

SEO Architect,SEO Specialist reflect my values.

By enduring black hat methods the SEO industry is setting itself up for washout and sleepwalking into oblivion.

Jobs in India