1

change the page title for user/register, user/password, user/login pages

http://drupal.org

Hi there,

Currently the user/register user/password and user/login all show the same page title (the title at the top of the browser shows 'User Account | sitename'). I want to change this as the below:

user/register => Create account | Sitename
user/password => Forgot password | Sitename
user/login => Log in | Sitename

I was able to find the below code and tried putting it into template.php under function theme_preprocess_page(&$vars) but it didn't work.
Then I tried in a custom module under hook_init function but it didn't work.

    if (arg(0) == 'user' && arg(1) == 'register') {
      drupal_set_title(t('Create new account'));
    } elseif (arg(0) == 'user' && arg(1) == 'password') {
      drupal_set_title(t('Request new password'));
    } elseif (arg(0) == 'user' && arg(1) == 'login') {
      drupal_set_title(t('Log in'));
    } elseif (arg(0) == 'user' && arg(1) == '') {
      drupal_set_title(t('Log in'));
    }

I'm trying to find the best way (performance wise) to correctly change the page title on these pages plus maybe other pages.
Would anyone be able to assist with this?

Thank you!

Read »
Created by aaron 1 year 37 weeks ago – Made popular 1 year 37 weeks ago
Category: Services   Tags:

PSD to Drupal Theme

Drupal Development

Module Development

Get an Estimate

Tags for change the page title for user/register, user/password, user/login pages

Recent comments