Drupal 7 View to list content created by logged in user
Solution 1
This five minute video shows how to do it, as well: http://nodeone.se/sv/node/684
With contextual filters you can also display the list as a tab on each user page (as shown in the screencast).
If you're interested in a list that always shows the current user's posts, you can use a standard filter instead – there is a "current user" filter available.
Edited: The original link is broken. I'm not sure which video it was, but it could be one of the following (which all deal with this topic).
- https://vimeo.com/22276809 Video guide
- https://vimeo.com/33588889 Exercise description
- https://vimeo.com/33588956 Exercise solution
Solution 2
For drupal 7
Steps for doing as the above question are
- Under "When the filter value is not available," select "Provide a default value," and select "User ID from URL" from the dropdown. Because blocks don't understand contextual filters very well, the view won't work properly without this default value, and all posts of the given content type will show on all user pages (not just the user's own posts).
- Under "When the filter value is available or a default is provided," check "Specify validation criteria" and select "Basic validation" as the validator. Select "Hide view" from the dropdown.
Justin
Updated on June 04, 2022Comments
-
Justin almost 2 years
I've just started using D7 and was trying to set up a system where people can add a couple types of content and associate one with the other via nodereference.
I only want users to be able to see and work with their own content.
To achieve this in D6 I used a view for nodereference.
In D6 I used argument : user: uid and if there is no arg, it uses the user id of the logged in user. This would return all of the content that was authored by the user.
I haven't been able to figure out how to do this in Views 3?
got it: you first need to add a User relationship, then you will see new filters and contextual filters - one of which is "current user" or something like that
-
Marco Lazzeri over 10 yearsI cannot see any "current user" filter in my Drupal 7 Views. Ideas?
-
Marco Lazzeri over 10 yearsFigured out: 1) add the relationship 2) SAVE 3) add the filter.