Saturday, July 26, 2008

Theming in Drupal 6 - Key Learnings at the Lullabot workshop

Lullabot





1. If we did not define a node.tpl file in our theme:
Druapl6 , the default file is that available in with the node module.
Drupal5, the default file was available with the php-engine

2. All new Preprocessor functions in Drupal 6:
Preprocess functions only apply to theming hooks implemented as templates. The main role of the preprocessor is to setup variables to be placed within the template (.tpl.php) files. – this means that the variables defined with in the Preprocessor functions are available only with in the template files.
Template suggestions can be made in the preprocessor functions, based on available hooks

3. Use the themer info to identify which theme function is associated with a particular content and update the same as in the case of
function mytheme_preprocess_taxonomy_term_page(&$variables) {
}The same hooks are also available from inside these theme functions.

The main Diffference in theming in Drupal 5 vs Drupal 6
In Drupal 5 the theme could be altered using the _phptemplate_variables function. The templates could be altered only from the template.php file. The only way to override the formatting at the module level was to override rendering in the template.php file.
In Durpal 6 since we have the preprocess functions we can access the templates at the module level

Read more at Theme guide (Drupal 6)

1 comment:

  1. Hi,

    Do u know how to create different home page and one common inner page in drupal 6?

    can i get the code for that?

    Thanks,
    softsovlers

    ReplyDelete

Search This Blog

Chennai Drupal Community

drupal.org - Community plumbing

Shyamala's Drupal SEO