[英]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.