アカウント作成ページのデザインを変更したいのです

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
yamauchi's picture

D7でアカウント作成ページのデザインを変更したいのですがuser-register.tpl.phpのファイルをテーマ内のtemplatesフォルダに入れても反応がありません。

template.phpの書き足しなどが必要なのでしょうか?またファイル名や保存場所に間違いがあるのでしょうか?
わかる方、ご回答よろしくお願いします。

Comments

https://www.drupal.org/docs/7

blauerberg's picture

https://www.drupal.org/docs/7/theming/overriding-themable-output/customi... に情報がまとまっています。

D7だとテンプレートファイルの名前は user-register-form.tpl.php ですね。
ファイルをどこに置くかはテーマによって違う可能性があります。

yamauchi's picture

回答ありがとうございます。
ファイル名をuser-register-form.tpl.phpに修正し添付して頂いたURLに記載されているtemplate.phpファイルの修正もおこなってみたのですが表示が変わりませんでした。
英語が苦手なのでtemplate.phpファイルの修正が間違っているかもしれません。
テーマ名はportalで保存場所はテーマファイル内のtemplatesフォルダに入っています。

function portal_theme() {
$items = array();

$items['user_login'] = array(
'render element' => 'form',
'path' => drupal_get_path('theme', 'portal') . '/templates',
'template' => 'user-login',
'preprocess functions' => array(
'portal_preprocess_user_login'
),
);
$items['user_register_form'] = array(
'render element' => 'form',
'path' => drupal_get_path('theme', 'portal') . '/templates',
'template' => 'user-register-form',
'preprocess functions' => array(
'portal_preprocess_user_register_form'
),
);
$items['user_pass'] = array(
'render element' => 'form',
'path' => drupal_get_path('theme', 'portal') . '/templates',
'template' => 'user-pass',
'preprocess functions' => array(
'portal_preprocess_user_pass'
),
);
return $items;
}

function portal_preprocess_user_login(&$vars) {
$vars['intro_text'] = t('This is my awesome login form');
}

function portal_preprocess_user_register_form(&$vars) {
$vars['intro_text'] = t('This is my super awesome reg form');
}

function portal_preprocess_user_pass(&$vars) {
$vars['intro_text'] = t('This is my super awesome request new password form');
}

もし間違いがあればご指摘いただけたらと思います。
よろしくお願いします。

yamauchiさん、user-register-for

Shumpei's picture

yamauchiさん、

user-register-form.tpl.phpは/templates内でOKですが、template.phpはテーマのルートフォルダ(portal.infoファイルと同階層)に保存されてますでしょうか?

あと、キャッシュのクリアも必要になります。

yamauchi's picture

ありがとうございます。
無事設定することができました。

portal.infoのファイル名が文字化けしておりました。
ファイル名を修正するとすぐに表示されました。

お手数をおかけしましたが何とか修正することができました。
ありがとうございます。
また何かありましたらよろしくお願いします。