On my site, users can create content. When a different user/person is viewing content on the site, I want to have a block on the right side that displays user profile information about the user that posted the content that is being displayed.

How would this best be done? I thought creating a view that somehow accessed the "Submitted by" information would make sense, but I don't see this option available as a filter or in the relationship. Can anyone make a suggestion about how I might go about doing this?

Thanks

Comments

nevets’s picture

Are you using core profile or content profile for the profile?

bchoc’s picture

You might consider something like panels or context modules.

obironkenobi’s picture

I'll look at some of these modules, but I'm wondering if I can do this without installing another module. Is there a way to pull a nodes "creator" through a Relationship or through a Filter in Views? I'm trying to get a better grasp of the Views mod and still have a long way to go. If anyone can point me in the right direction that would be great.

nevets’s picture

Yes, answer depends on if you are using core profile or content profile.

ludo1960’s picture

That's twice Nevets has asked you the same question, any chance of an answer?

obironkenobi’s picture

Sorry for the delay in responding... I am using just the core profile functionality.

nevets’s picture

Create a view of view type 'user'.

Under 'Fields' add the profile fields you want to display.

Add an argument on "User: Uid"
Set "Action to take if argument is not present" to "Provide default argument"
Set "Default argument type" to "PHP code"
In the textbox (for the code) add

$uid = -1;
$node = menu_get_object();
if ( !empty($node) ) {
  $uid = $node->uid;
}
return $uid;

I set "Validator" to user.

Save/update the argument.

I then set title (under basic settings) to "About %1", the %1 will be replaced by the user name (login). Title will be used for block title.

Now add a block display.

Save the view.

Add the new block to a region.

Visit a node.

obironkenobi’s picture

Beautiful... THANK YOU SO MUCH!