Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

Searching in Google I found user-profile.tpl.php , but in fact this is the node of profile page while I want to create page.tpl.php foe the profile page. Also page-user.tpl.php includes login page, register page and all the pages belong to a user which I do not consider, I need to create page.tpl for profile page

share|improve this question

2 Answers 2

up vote 2 down vote accepted

the best way to handle this that i've come up with is a combination of 4 files:

  • page-user.tpl.php for the far-back profile edit as igor said
  • user-profile.tpl.php for the profile content
  • page-user-register.tpl.php set to match page.tpl.php in order to keep page-user.tpl.php from overriding the register page, and
  • page-user-login.tpl.php set up in the same way as page-user-register for the same reason.
share|improve this answer

Try this...

page--user-profile.tpl.php

[page]--[node].tpl.php

or actually...

page--user.tpl.php

To see available templates for this page simply do the following in your themes template.php

function YOURTHEME_preprocess_page(&$variables) {
   echo '<pre>'; var_dump($variables['theme_hook_suggestions']); echo '</pre>';
}

If nothing were in there (doubtful), then just add your own...

if ($SOME_CONDITION) {
    $variables['theme_hook_suggestions'][] = 'page--user-profile.tpl.php';
}
share|improve this answer
1  
The method of using preprocess and a theme hook suggestion is how I'd do it. +1 –  Beebee Dec 5 '12 at 16:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.