I have created a image field in the user account. How can I add the image of the author to the display of each node?
1 Answer
You may do that using a Views Block and place it in the Main Content block region, right after the content block. Also, you'll need to create a relationship between the node and it's author, so only the correct user will be displayed. Below is a screenshot of a work I've done using Views for Drupal 7.42 that I think is close to what you're looking for:
1 - Create a new Block View to view Users (not Content)
2 - Filter Criteria should say User: Active (Yes)
3 - There is a default sort Criteria item. Remove it since it doesn't matter.
4 - Add a Relationship: Choose "User: Content authored"
5 - Add a Contextual Filter: Chose "Content: Nid"
6 - In the configuration options for the newly added Content: Nid, choose these options: WHEN THE FILTER VALUE IS NOT AVAILABLE: Provide default value In the Select box, choose Content ID From URL.
WHEN THE FILTER VALUE IS AVAILABLE OR A DEFAULT IS PROVIDED Specify validation criteria Validator select box: Content Content Types: choose the content types you want the view to work with. Filter Value Format: Node ID Action to take if the filter value does not validate: Hide View
7 - Save the View.
8 - Go to Structure -> Blocks and configure the block to show on the types of content you want it to show on and position it wherever you want it to appear.
9 - Done.
-
Could you please add the contextual filters and relationships screenshots? Commented Feb 14, 2016 at 23:07
-
I've edited the answer with a more precise walktrough. Commented Feb 14, 2016 at 23:38