The title basically outlines the problem I am having and actually I'm quite surprised Views runs into this sort of problem. What I want to do is use a views block to display the content a user has created on their particular profile and if you go to another users profile it will display the content that user has created. As of now, the closest thing I have been able to get views to do is to display all the content that is created and haven't been able to filter it by the currently viewing profile. Is there a way to do this that I am overlooking or is it just not within the capabilities of views right now? Any help would be greatly appreciated.

Comments

metazoid’s picture

This was ridiculously convoluted but I figured it out. For those that wish to do something similar on their own sites here is what I did:

First I created the Argument for User ID in views. Then I created a custom block to replace the block which displays the data outputted by the view. In the block I replaced: <? print $content; ?> with <? $view = views_get_view('View_Name'); print $view->execute_display('',array(arg(1))); ?>. This basically allows me to display the view and parse arguments to it via the array. The argument that makes it unique via user ID is arg(1) which you can replace with whatever you choose. I hope this can be helpful to someone in the future.

merlinofchaos’s picture

Status: Active » Fixed

Or you could've used a normal block display, for the user: uid argument select 'provide default' and then select 'User ID from URL'.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

fossle’s picture

I need to do the same thing. Are you referring to when you are in the Views UI? I don't see the option for 'provide default' after I chose user:uid for the argument.

Any help would be appreciated.

Thank you,
Kim

fossle’s picture

I figured it out using your suggestion.

Thank you.