How to override theme function in Drupal 6?
In your template.php, use hook_theme() API function to override the output of the theme.
As an example, we use the code below in template.php:
<?php
/**
*
* In this case, we are overriding user_login functions
*/
function yourtheme_theme() {
return array(
'user_login' => array(
'template' => 'user-login',
'arguments' => array('form' => NULL),
),
);
}
?>
Now, Drupal would expect to see user-login.tpl.php in your theme folder (which is yourtheme). You can do print_r($form) and control the output of your form that is printed on the login page.
- programmer's blog
- login or register to post comments