Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Falcox on
Hello,
I'd like to create a block that display informations on the author of the article. These informations are saved in different fields that I've created in the Users part of Drupal.
I guess I have to create a View and use contextual filters to get these fields, but I don't know how to do...
Thanks for your help !
PS : I use Drupal 8.x
EDIT : Finally found the solution
- In Configuration / Users / Account settings / Manage fields, create a text field (call it author_information for instance) where you will store informations about the authors.
- In Structure / Content types / Your content type / Manage fields, create a User field (call it Authors for instance).
- In Structure / Viewmodes, create a new display viewmode in the Users section. Select fields that you want to display in this viewmode (author_information in particular...). This will be the fields that you will display in your views.
- In Structure / Views, create a new View:
- In fields, select the field Authors you've created in step 2.
- Click on the link and in display tool, select Rendred entity
- In viewmode, select the one you created in step 3
Comments
The Author Pane module can do
The Author Pane module can do this, however it still does not have a D8 version. You can watch to see when the D8 version is released.
Thx for your help. I hope
Thx for your help. I hope this module will soon have a D8 version.
Meanwhile, I wish that someone will have a solution for me, using Views. :)
=-=
I don't see an immediate solution using views. You may be able to get parts of it working. May make sense to write your own block module.
OK, thanks for the advice.
OK, thanks for the advice.