Skip to content

Instantly share code, notes, and snippets.

@jeremycaldwell
Created August 30, 2013 22:52
Show Gist options
  • Save jeremycaldwell/6395060 to your computer and use it in GitHub Desktop.
Save jeremycaldwell/6395060 to your computer and use it in GitHub Desktop.
Drupal 7 - Change page title based on path.
function THEMENAME_preprocess_page(&$vars) {
if (arg(0) == 'user' && arg(1) == 'login') {
drupal_set_title(t('Login'));
}
if (arg(0) == 'user') {
drupal_set_title(t('Login'));
}
if (arg(0) == 'user' && arg(1) == 'password') {
drupal_set_title(t('Request password'));
}
if (arg(0) == 'user' && arg(1) == 'register') {
drupal_set_title(t('Create new account'));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment