I want to hide the title print out on user profile pages. I am using Advanced User Profiles with Author Pane, and I think it looks better with no page title. However, if I set the page to "no title" in Panels, my browser window shows " | Site Name" instead of the desired "User Name | Site Name".

In the body section of page.tpl.php, the title print out seems to be:

<?php if ($title): ?>
  <h1 class="title"><?php print $title; ?></h1>
<?php endif; ?>

Is there a way to change that to basically say: "If the page is a user profile, print nothing. Else, print $title"?

That way my titles will still show up in the header universally, but not in the bodies of user profiles.

Does that make sense? Is it possible?

Thanks.

Comments

uomeds’s picture

Never mind. From the explanation of theming here:
http://drupal.org/node/104316

I just created a copy of page.tpl.php called page-user.tpl.php and deleted those three lines. Seems to have worked perfectly.

wmasterj’s picture

I was looking for this exact solution. But wasn't fully happy
The reason was we have chosen to use the email address as the user name, so the user name cell in the database is the email address. We dont want peoples email addresses to be shown at the top of their user profiles even if that is their usernames. I didn't find a way to change the output of the title to the user name so I followed this solution.

But when i simply hid the title it still showed it in the title of the browser window.

I did the following tweak to fix that.
In the header I replaced:

<title><?php print $head_title ?></title>

With:

<?php $title = explode('|', $head_title); ?>
<title><?php print "User profile |" . $title[1]; ?></title>

This works fine, but my wish would be to change the title dynamically before it is outputted so that i dont need these tweaks but can simply specify the user name as the title which would then show in both the browser title and the page content title. Anyone know how?