0

(アダプティブテーマの使用)新しいカスタムユーザーログインページが必要です。だから、このコードを私のtemplate.phpに入れてください:

function mythemename_theme() {
  $items = array();
  // create custom user-login.tpl.php
  $items['user_login'] = array(
  'render element' => 'form',
  'path' => drupal_get_path('theme', 'mythemename') . '/templates',
  'template' => 'user-login',
  'preprocess functions' => array(
  'mythemename_preprocess_user_login'
  ),
 );
return $items;
}

mythemenameをカスタムテーマ名に変更しました。そして、user-login.tpl.phpファイルを作成し、次のコードを配置します。

<?php 
  print drupal_render($form['name']);
  print drupal_render($form['pass']);
  print drupal_render($form['form_build_id']);
  print drupal_render($form['form_id']);
  print drupal_render($form['actions']);
?>

最後に、サイトのキャッシュをクリアしました。しかし、mysite.com/userのログインページをクリックしても変更されません。

エラーはどこで発生していますか?どうすればこの問題を解決できますか?

4

1 に答える 1

1

これをtemplate.phpに入れて、mythemenameをtheme nameに変更し、キャッシュをフラッシュしてみてください。

function mythemename_theme($existing, $type, $theme, $path){
    $hooks['user_login']=array(
    'render element'=>'form',
    'template'=>'templates/user-login',
    );
    return $hooks;
}

次に、templates/user-login.tpl.phpに次を挿入します。

<?php
print render($form['name']);
print render($form['pass']);
print render($form['form_build_id']);
print render($form['form_id']);
print render($form['actions']);
?>

また

<?php print drupal_render_children($form) ?>
于 2013-03-19T04:24:43.650 に答える