Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.3
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
15 Mar 2009 at 00:04 UTC
Updated:
4 Apr 2010 at 22:37 UTC
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
Comment #1
metazoid commentedThis 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.Comment #2
merlinofchaos commentedOr you could've used a normal block display, for the user: uid argument select 'provide default' and then select 'User ID from URL'.
Comment #4
fossle commentedI 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
Comment #5
fossle commentedI figured it out using your suggestion.
Thank you.