| Drupal

show-drupal-own-contentIf 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.


About the author

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.