Hello guys,

I'm using profile 2. I was looking for a way to create tabs for each profile type on the user profile page but couldn't figure it out, so I decided to create the links manually.

Here's what I did in page--user.tpl.php (I wanted to show this on the page rather than user-profile.tpl.php)

 <?php print l("Personal Details | ",'profile-personal_details/'.$account->uid); ?>

It works, but I get the following error messages

  • Notice: Undefined variable: account in include() (line 131 of C:\wamp\www\sitename\sites\all\themes\nolly\templates\page--user.tpl.php).
  • Notice: Trying to get property of non-object in include() (line 131 of C:\wamp\www\sitename\sites\all\themes\nolly\templates\page--user.tpl.php)

Please, what am I doing wrong? The above method works for my purpose, but I just don't like seeing the error messages.

Also, is there a better way to create tabs for Profile 2 profile types?

Thanks.

Comments

cnario’s picture

Anybody?

cnario’s picture

I finally figured it out!

I used rules to rewrite the path, then used the following code to link to it

<?php print l("Personal Details | ",'profile-personal_details/'.$user->uid); ?>
cnario’s picture

I'm still having problems with this.

This code is pointing to my profile

<a href="<?php print base_path(); ?>contact/<?php print render($user->uid); ?>">

How do I get it to point to the user being viewed (not the currently logged in user)? Please I"m not good in PHP and I really need help with this.

Thanks.