Michiel
Michiel

Reputation: 8103

Style Drupal 7 log-in page (with hook_prepare/hook_preprocess)

Despite a previous solution to my own question, I'm not completely satisfied. I now have three exactly the same pages (page.tpl.php, page--user.tpl.php and page--user--login.tpl.php) with only a slight difference in the last page. So if I have to edit a single div for some reason, I have to change it in all three pages.

So I'm looking for a more solid solution (it will probably be in the template.tpl-file with a hook_prepare/hook_preprocess. But I have no idea how to do this... Can anyone provide me with some hints or info?

Upvotes: 0

Views: 413

Answers (1)

DuaelFr
DuaelFr

Reputation: 395

It is not the better solution for me but you can use the arg() function in your page.tpl.php like this :

if (arg(0) == 'user') {
  // Do something
  if (arg(1) == 'login') {
    // Do something else
  }
}

Depending on your needs you may also customize your pages using only CSS rules as body tag carry some usefull classes.

Upvotes: 2

Related Questions