- Drupal 8 Development Cookbook(Second Edition)
- Matt Glaman
- 232字
- 2025-04-04 18:20:51
How to do it...
- Go to Structure and then Views. This will bring you to the administrative overview of all existing views.
- From the Enabled section, select the Edit option from the operations column for the Content view. This is the view displayed on /admin/content when managing content.
- To filter by the content author, we must add a FILTER CRITERIA to our view, where we will expose the following for users to modify:

- Click on Add in the FILTER CRITERIA section to add a new filter. In the search textbox, type Authored by to search the available options. Select Authored by for the Content category. Click on Add and configure filter criteria:

- Check the Expose this filter to visitors to allow them to change it checkbox. This will allow users to modify the data for the filter.
- You may modify the Label and add a Description to improve the usability of the filter option for your use case.
- Click on Apply once more to finish configuring the filter. It will now show up in the list of filter criteria. You will also see the new filter in the preview below the form.
- Click on Save to commit all changes to the view.
- Take a look at /admin/content, and you will have your filter. Content editors will be able to search for content authored by a user through autocompleted username searches:
