Drupal7修改用户登录没有效果?

Drupal7 modified user login no effect?

我是 Drupal 新手。我正在尝试创建修改后的登录页面。

我在 /sites/all/themes/cmse/

中用名称 "cmse" 修改了主题的 template.php

这是我的 template.php:

<?php
function cmse_preprocess_html(&$vars) {
  $vars['classes_array'][] = 'homepage';
  $vars['classes_array'][] = 'teaser';
}
function cmse_theme() {
  $items = array();
  // create custom user-login.tpl.php
  $items['user_login'] = array(
  'render element' => 'form',
  'path' => drupal_get_path('theme', 'cmse') . '/templates',
  'template' => 'user-login',
  'preprocess functions' => array(
  'cmse_preprocess_user_login'
  ),
 );
return $items;
}

这是 /sites/all/themes/cmse/templates

中的新文件 "user_login.tpl.php"
<?php
    // split the username and password so we can put the form links were we want (they are in the "user-login-links" div bellow)
    print drupal_render($form['name']);
    print drupal_render($form['pass']);
    ?>
    <div class="user-login-links">
    <span class="password-link"><a href="/user/password">Forget your password?</a></span> | <span class="register-link"><a href="/user/register">Create an account</a></span>
    </div>


    <?php
        // render login button
    print drupal_render($form['form_build_id']);
    print drupal_render($form['form_id']);
    print drupal_render($form['actions']);
    ?>

所有更改对我的登录页面没有任何影响。任何想法出了什么问题?

提前致谢

可能有多种原因。

Drupal 缓存非常臭名昭著,因此请确保清除缓存。您可以通过说明 here

Clearing the cache The easiest way to clear the Drupal cache is to go to Administration > Configuration > Development > Performance (http://example.com/admin/config/development/performance) Click the button "Clear all caches"

您是否select编辑了新主题而不是现有主题? 按照说明 here 了解如何 select 新主题。

此外,仅将值替换为新主题名称 cmse 可能不起作用。正确的做法是添加自定义模块,然后从那里调用 .tpl.php 文件。