Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
How can I tell Omega I want to override user login/register pages, use a custom tpl and feed variables to it? This is what I tried:
function mycustomtheme_theme(&$existing, $type, $theme, $path) {
$hooks = omega_theme($existing, $type, $theme, $path);
$hooks['user_login'] = array(
'template' => 'user-login',
'arguments' => array('form' => NULL),
);
$hooks['user_register'] = array(
'template' => 'user-register',
'arguments' => array('form' => NULL),
);
return $hooks;
}
function mycustomtheme_preprocess_user_login(&$vars) {
unset($vars['form']['pass']['#description']);
$vars['form']['submit']['#prefix'] = '<div id="edit-submit-wrapper">';
$vars['form']['submit']['#suffix'] = '</div>';
$vars['rendered'] = drupal_render($vars['form']);
}
Two things: in the TPL, Drupal won't print that rendered var. It does make it into the array. Commenting out those changes brings the form back. Two, should I move this into preprocess-user-login.inc? I could not get that to pick up either.
How can I override this page and feed/change page variables?
Comments
Comment #1
kevinquillen CreditAttribution: kevinquillen commentedScratch that, I had a typo in my var in the TPL. I still can't make it run from a .inc file in the preprocess folder, I would like to so I can keep template.php clean. What did I miss?
Comment #2
ebeyrent CreditAttribution: ebeyrent commentedI just wrote about this: http://beyrent.net/blog/2011/05/theming-drupal-7-user-registration-form
Comment #3
Rosamunda CreditAttribution: Rosamunda commentedThankd for the link, but how do you do that in D6?
I´ve tried what ebeyrent did, but the form is unaffected.
This is my tpl template:
Any thoughts? What is wrong with this?
Thanks for your help!
Rosamunda
Comment #4
marcoka CreditAttribution: marcoka commentedwith overriding i think you want to output different markup.
take a look at:
http://drupal.org/node/173880