0

I'm working on a Drupal 7 install sub-theming zen. I have a blog and I want to have an "About the author" view on each blog post. I've created a custom post type (Profile) for this, but I'm not sure how to make my view aware of the user who has created each post to show the Profile depending on the post author. I know this used to be done with the view arguments but that's part of Contextual Filters in Drupal 7, but I still don't know what filter I should have there, or if I should add any fields in the Profiles so that the filters can tell which profile belongs to which author.

Any help will be most welcomed!

0

You don't need to create separate content types in D7, You are able to attach fields to the user directly (admin/config/people/accounts/fields). If you need more flexibility, use the Profile2 module.

If you just add fields to the user, you can create a new block view of users. Under "Contextual Filters" (which is under Advanced on the right side), add a filter of User: Uid, set it to Provide default value, with a type of User ID from URL, and check the checkbox for Also look for a node and use the node author.

Then add the fields normally as you see fit.

1
  • I'm using pathauto, will it still be able to get the id there? – la_f0ka Jul 27 '11 at 21:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.