Show Drupal Users Their Own Content

show-drupal-own-content

If you have multiple content creators on your site, you may want to make their life easier.

One way that you can help is by providing a list of the content they have created.

There are advanced ways to do this, such as using the Workbench module, but in this tutorial we’ll show you an easy way to provide a list of each user’s content.

The only module that you need to do this is Views: http://drupal.org/project/views.

  • Get started by going to Structure > Views.
  • Click Add new view.
  • Enter a View name.
  • Choose to create a block.
media_1386106465094.png
  • Click Continue & edit.
  • Find the Relationships area on the right-hand side and click Add.
media_1386106565625.png
  • Search for and choose Content: Author
media_1386106599828.png
  • Click Apply (all displays) twice.
  • Find the Filter Criteria area on the left-hand side and click Add.
media_1386106701331.png
  • Choose User: Current.

[Note] In Views 2, this option was available without adding the relationship first. Now, you must make sure the relationship is added.

media_1386106784320.png
  • Click Apply (all displays).
  • Set Is the logged in user to Yes:
media_1386106839544.png
  • Click Apply (all displays).
  • Click Save in the top-right corner.

If you want to test that you’ve set up your block correct, try this test:

  • Click Add next to Fields.
  • Search for and choose User: Name.
  • Click Apply (all displays).

You’ll now be able to see the preview below. You can make sure that each content comes from the same author.

media_1386106993040.png

If this is correct, you can click Cancel to discard your changes.

You can now go and publish your block via Structure > Blocks.

Instructor

  • Steve is the founder of OSTraining. Originally from the UK, he now lives in Sarasota in the USA. Steve's work straddles the line between teaching and web development.

0 0 votes
Blog Rating
Subscribe
Notify of
7 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
pepperstreet

Thanks for the article.
BTW, here is an (older) related tutorial on “USER ACTIVITY PAGE USING VIEWS IN DRUPAL7. The interesting part is the creation of a special “Tab” on user account page.

[url=http://www.youtube.com/watch?v=iWWMvMPFS1Q]http://www.youtube.com/watc…[/url]
PS: If you are going to watch this with earphones… lower the volume. Hence the terms “tabs” and “title” 😀 😉 I promise you won’t get into sleep 😉

steve

Great, link, thanks Maik. Looks like Views 2, but should still work.

Geekwen

Thanks!

obionekenobi

thank you so much! this was just what i needed

James Rome

How can they see their unpublished content also?

Omar

I need to show all content list which a user created. i gave him rights to add and view own content already but when i logged in with that user i cant see any listing. i only seeing add content option.

how to show listing of own content for that user by default? is that only possible with view.4 kindly advice me i am new to drupal

imrodmartin

Hey Omar – this is a really old post – long before Drupal 8.  Can you give me the context of what you’re trying to achieve and how you did it, please?  I’ll respond here.
thanks – Rod

7
0
Would love your thoughts, please comment.x
()
x