Support view arguments for the hook workbench_content_alter

Created on 12 August 2020, over 4 years ago
Updated 21 September 2023, about 1 year ago

Problem/Motivation

The current workbench_content alter hook is very useful to override views conditionally in any of the regions. This could be improved by having it support view arguments (contextual filters).

The benefit is in designing similar views showing content depending on the user's role. For example, I might want to show only content in "To be reviewed" state to a user with the editor role. Right now, I'd have to create multiple views or view displays and load that. With this support, we would be able to use a single view and passing the moderation state in argument.

Remaining tasks

Write a patch

User interface changes

N/A

API changes

Adding a new array entry which is passed to hook_workbench_content_alter and subsequently to \Drupal\workbench\Controller\WorkbenchContentController::renderBlocks

Data model changes

N/A

✨ Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada hussainweb

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024