[英]Drupal7 modified user login no effect?
我是Drupal的新手。 我正在尝试创建修改后的登录页面。
我已经在/ sites / all / themes / cmse /中将主题的template.php修改为“ cmse”
这是我的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缓存非常臭名昭著,因此请确保清除缓存。 您可以通过此处的说明进行操作
清除缓存清除Drupal缓存的最简单方法是转到管理>配置>开发>性能( http://example.com/admin/config/development/performance )单击“清除所有缓存”按钮
您是否选择了新主题而不是现有主题? 按照此处的指示信息选择新主题。
此外,仅将值替换为新主题名称cmse可能不起作用。 正确的方法是添加一个自定义模块,然后从那里调用.tpl.php文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.