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.
Hi,
While trying to override the user login form I am successful in other themes. For instance with the garland theme i add:
<?php
function garland_theme() {
return array(
'user_login' => array(
'template' => 'user-login',
'arguments' => array('form' => NULL),
),
);
}
function ygarland_preprocess_user_login(&$variables) {
$variables['intro_text'] = t('This is my awesome login form');
$variables['rendered'] = drupal_render($variables['form']);
}
then i create user-login.tpl.php and add this:
<p><?php print $intro_text; ?></p>
<?php print $rendered; ?>
When i try to attempt this with the basic theme (after renaming the theme and all subsequent instances of basic to nqc ) I simply am not getting the template file I should be.
Do you know what could be the issue?
Comments
Comment #1
bradallenfisher CreditAttribution: bradallenfisher commentedOK, for anyone else out there who banged their head on this. You must either place the user-login.tpl.php file in the root of the theme (not in templates) or rewrite the location of the file in your template.php. Drupal will not find the file otherwise and theme.inc will yell at you.
Comment #2
damiankloip CreditAttribution: damiankloip commentedbaf139 I think you have sorted your problem out self sufficiently! This can be closed I think.
Comment #3
see15_aug CreditAttribution: see15_aug commented