To begin, I've tried MANY different methods. I'm worn down and very frustrated and hoping that someone can help me out here.

I'm using Content Profile, Panels, and Advanced Profile Kit. I want to have a custom page template (page.tpl.php) for ONLY the user's profile page. Basically, I want to remove the right sidebar on the user's profile page. Nothing more. It seems like a very simple idea. I know I need a custom page template, but I cannot get ANY of the methods below to work.

Requirement: Anything that appears after the user's profile page (e.g., /user/3/galleries) should NOT use this custom page template.

METHOD 1
The requirement above rules out the method here: http://drupal.org/node/104316 ("Using different page templates depending on the current path"). If I do it that way, everything in the path that comes after /user/ is also themed with the custom page template.

METHOD 2
I also tried this method: http://drupal.org/node/249726 ("page templates depending on node type"), but it seems that Drupal (or whatever is causing this) does not recognize the user profile page as a content type when it builds things (?) (even though the User Profile content type was created by Advanced Profile Kit, and is just a content type like any other). So this method is out.

METHOD 3
I also tried the method here: http://drupal.org/node/35728 ("Customizing the user profile layout"), using a custom file named user-profile.tpl.php. Someone wrote in another forum post that they believe Advanced Profile Kit is overriding all this, causing user-profile.tpl.php to be ignored (and that it has something to do with the fact that Panels is being used in conjunction with APK).

Nothing has worked thus far. I'm hoping that someone can help me here. I'm so beaten from working on this for about 9 hours now that I'm headed to bed. Any help that anyone can provide will be more than appreciated. I'm out of ideas.

Thanks!

Comments

Vasu’s picture

If you are using APK you can disable drupal blocks/regions in the user_view page (http://mysite/admin/build/pages/edit/user_view) under general setting tab. You can customize the page by modifying the panel layout and contents without having to use any custom template.

dmetzcher’s picture

Thanks for the reply, Vasu! :)

Disabling all blocks/regions means that I basically have to rebuild the entire page in panels, right? That seems like it would make updates later a little more painful than using a custom template just for the user profile page (if that's even possible)...updating blocks used for the main site and then again on the user profile panel. Is there no other way that makes it easier (like a custom template for the user profile page, or some similar trick)? Panels is excellent... but I like the idea that it's just for managing a portion of a page (the content area, for example, but not the header, footer, menus in header, etc).

I'm thinking that using the Context module might work, and I can use it just to manage the right-sidebar blocks for a few pages that come after /user (they are /user/galleries, /user/images, and a couple more). I only wanted to avoid using it because (1) it seems like overkill for the rest of the site, and (2) if I'm not going to use it to manage blocks for the entire site (and I'm not, as of right now), it would create another place where I'd have to go to edit blocks for a few different pages. If I use Context, I can just tell all blocks that are shown on the whole site to not display on user/* (block visibility settings) and then add them to any pages where I want them under /user/... (since Context does not respect a block's visibility settings, which is a good thing in this case).

Thoughts?

michelle’s picture

When you disable regions, it doesn't disable the header or the footer. I'm not sure what magic it uses to figure out what to disable but it's always worked fine for me. Keep in mind that you can add your regular blocks to a page that Page Manager (panels) has taken over. So you don't need separate blocks for the parts you recreate. The only upkeep would be if you changed the order of the blocks or removed/added some and then you'd need to do that on your custom page as well.

Michelle

dmetzcher’s picture

Interesting. I may give that a go.

I ended up using the Context module to place blocks on certain pages but not on the user profile pages. I have more control that way, even if I now have two places to manage blocks. If it's only for a few pages (really, just views that have paths like /user/3/view-page-path) it shouldn't become too unmanageable.

All this would be solved by a module that can hack the core Blocks module so that the visibility settings for paths can accept these sorts of paths:

user/*/page-name
or even...
user/arg(1)/page-name

That way, if I use an asterisk in the middle of a path, the block will display on the following pages (using the example above):

user/3/page-name
user/4/page-name
etc, etc, etc...

Michelle: Do you think this sort of module is easily possible? If so, I'd be interested in contributing to a bounty to get it done for Drupal 6 if someone is interested in doing the harder work of coding it. I looked around and couldn't find anything that does this, but maybe I missed it? Seems like a "Supercharged Blocks" module would be useful for a lot of people who use Context or Panels to do all this right now, both of which seem like more work just for getting this done (but are excellent modules for their broader uses).

Thanks!

michelle’s picture

I don't remember offhand if there's any sort of block alter hook. If so, it might be worth doing. If I weren't using Panels, I would just do that in the php visibility section but that requires the phpfilter module which many sites disable.

Michelle

robin1988’s picture

I have 2 views for user profile : image and videos(for user to add youtube videos) and i wrote this code in template.php

function phptemplate_preprocess_user_profile(&$vars){
$vars['videos_user'] = l('video','user/' . $vars['account']->uid . '/videos');
$vars['photos_user'] = l('photo','user/' . $vars['account']->uid . '/photos');

}

and then just simply printed out the variables in user-profile.tpl.php and i get a nice button on the top of the user profile showing the photos of every user and videos of every user like you have in many social n/w sites. But what i want now is that a user profile page should have panels and like 2 sections the left containing all the text like hobbies, about me ,contact etc and the right panel section containing the thumbnail of images in a grid style.

Is there any way to achieve this using panels??

dmetzcher’s picture

Are you looking to do something like this?...
http://me2oh.com/user/darius-arunian

Is that what you mean? Panels can do that very easily.

The left sidebar is created by the theme itself. The main content area of the page contains columns created by panels.

robin1988’s picture

yes yes yes....
I like the link you posted and i want something like this on my website.
But how can i have panels working in user profile page.
Can u help me or just provide me a link to some tutorial or any module which can help me achieving this

dmetzcher’s picture

I'm using...

  1. Advanced Profile Kit
  2. Content Profile: Creates profile nodes for your users (instead of using core profile). I'm not sure you need this in order to use Panels.
  3. Panels 3: Is what you controls the layout of the page I linked in my previous comment.

Panels is what you really need to create the panel pages that I created for my user profiles (I also used it for Organic Groups home pages and a few other custom content types that I created).

...and be sure to read this page for APK setup: http://drupal.org/node/517182

robin1988’s picture

ok thanks
but actually i had read this page previously. Anywaz if you say so i will deep read it again.
One thing that doesnt gets in my head is that how can i set a panel layout for a particular node type.
Once i get to know that then i can use the content profile module and set panel layout for user profile.
Anywaz thanks for the help.
I would appreciate if you could direct me to some video tutorial.

dmetzcher’s picture

You want this page on your site for setting up a panel for a specific node type:
/admin/build/pages/list

In my previous comment, I referenced...
http://drupal.org/node/517182
...this is what I used to set up Advanced Profile Kit. You really need this along with Content Profile in order to make it all work. It will give you the uprofile content type. You'll find a file named "uprofile.full.export" inside the folder you download. That's the uprofile content type. I deleted most of the fields it created because my site is a bit specialized and I needed fields to be named a certain way, but I imagine it would work for most sites with minimal deleting of fields.

As far as a video tutorial, I don't think one exists. If you find one, post it back here in a comment and submit a documentation request to whichever module it trains you to setup so that the developer can add a link to it on that module's project page.

spudette77’s picture

Hi dmetzcher,

I am wondering how you got the tabs at the top of your user-profile page the way you wanted it? I am using Advanced Profile Kit and Content Profile, and the My Account page has a massive amount of automatically generated tabs that make the whole page really messy. Plus, I have a profile edit page generated by Content Profile, and a User Profile edit page generated by APK. I am very new at this and have been trying to figure this out for a week and is driving me crazy!!

Do you... or anyone else have any tips that may help me suss out what is going on here? I love you profile page and would like something similar in terms of functionality on my site.

dmetzcher’s picture

One thing to keep in mind is that you will see a good deal more tabs at the top of your profile page(s) if you are logged in as an administrator. This largely depends on the modules you have installed and the views that they (or you) created. Have you logged in with a non-admin user account and taken a look at the My Account page owned by that user?

In terms of my profile pages, a user will currently see the following tabs at the top if they are (1) logged in, (2) viewing their own profile page, and (3) not an administrator.

  1. View (Drupal Core, standard)
  2. Edit (Drupal Core, standard)
  3. Friends (User Relationships, module)
  4. Notifications (Notifications, module)
  5. Posts (Advanced Profile Kit, module) -- I'm 99% sure APK created this tab, but I haven't confirmed that.
  6. Second Life (SlUser, module)
  7. Statuses (Facebook-style Statuses, module)
  8. Track (Drupal Core, standard)

The Posts and Track tabs are basically the same (Posts omits a few things that Track shows)...and I may remove the Posts tab, simply because I like to stick with Drupal's default features whenever possible, unless I really need something else.

It's actually a rather small number of tabs for a user who is not an admin. The one specific to my site that you will probably not have (unless you are tying your users to their Second Life avatars) is the Second Life tab. None of my tabs are custom (created by me). All are either created by Drupal (Core) or a module that I've installed.

Hope that helps. You might want to log in as a non-admin user, view that user's profile page, and reply back with the names of the tabs, if you still feel that there are too many.

I love you profile page and would like something similar in terms of functionality on my site.

Thanks! I spent a couple of months working on it before I was anywhere near happy and before I launched the site for beta testing. Getting the layout just right is still an ongoing process, but I'm pretty happy with it and I haven't really touched it for over a month now (other than adding status updates and shifting a few things around since I first replied to this thread).

michelle’s picture

Yes, it's from APK. It's a view so it's easy to just go in and modify the view to not make a menu tab.

Michelle

dmetzcher’s picture

Thanks, Michelle, for confirming that about the Posts tab. :)

ukbattery’s picture

I am wondering how you got the tabs at the top of your user-profile page the way you wanted it? I am using Advanced Profile Kit and Content Profile, and the My Account page has a massive amount of automatically generated tabs that make the whole page really messy.

dmetzcher’s picture

I don't think I edited the tabs at the top of the My Account page at all. I only installed the modules that I needed and they created the tabs. There is one tab that I will eventually remove, but it's not much of a problem for me if it stays there forever.

If you're logging in as an admin, you will likely find that you have more tabs than your average user. You can do more than the average user, so you want to see what they'll see, instead. Log out as an admin user and log in as a "regular" user, whatever that means for your site. If your users are mostly going to be authenticated users, create a test account and give it that role. If you have a custom role that your users will be placed into, place your test account into that role. Then, log into your test account and see how many tabs are at the top of its own My Account page.

Still too many tabs? If so, you'll need to track down the Views or modules that are adding the tabs. If you've got a view adding a tab, you can go in and remove the menu entry (which will be using a Tab to display itself) on the view (you'd simply have to find the view, and then find that view's display that's creating the tab menu entry).