Moderation Sidebar
Provides a frontend off-canvas sidebar for Content Moderation, enabling editors to quickly view moderation status and change workflow states.
moderation_sidebar
Install
composer require 'drupal/moderation_sidebar:8.x-1.8'
composer require 'drupal/moderation_sidebar:8.x-1.5'
Overview
Moderation Sidebar provides an off-canvas menu to moderate content entities directly from the frontend. When viewing any moderated entity, a "Tasks" button appears in the Drupal toolbar that opens a sliding sidebar panel. This panel displays the current moderation state, revision information, and provides quick action buttons to transition content through workflow states.
The module integrates seamlessly with Drupal's Content Moderation module, automatically detecting moderated entities and displaying appropriate workflow transitions. It supports multilingual sites through Content Translation integration, showing translation status and quick links to create, view, or edit translations. For nodes, it also provides a built-in revision history view within the sidebar.
Site administrators can configure which workflow transitions appear in the sidebar on a per-workflow basis, allowing them to hide certain transitions from all users when needed. The sidebar uses AJAX-enabled off-canvas dialogs for a smooth, non-disruptive user experience.
Features
- Off-canvas sidebar panel that opens from the toolbar when viewing moderated entities
- Displays current moderation state with color-coded status indicator (Published/Draft/Draft Available) in the toolbar
- Quick transition buttons to change workflow states without leaving the page
- Custom revision log message support when performing state transitions
- View and switch between live content and draft revisions
- Discard draft functionality to revert to the published revision
- Built-in revision history view showing the last 5 revisions (for nodes)
- Translation overview showing status of all language versions with quick View/Edit/Create buttons
- Configurable transition filtering to hide specific workflow transitions globally
- Toolbar integration with visual state indicator showing current moderation status
- Integration with Quick Edit module to refresh sidebar after inline edits
- Support for any revisionable content entity type (nodes, taxonomy terms, etc.)
- RTL language support in the sidebar UI
Use Cases
Quick Editorial Review Workflow
Editors viewing published content can click the Tasks button in the toolbar to see the current moderation state. They can quickly create a new draft by clicking 'Edit content', or if a draft already exists, they can view it by clicking 'View existing draft'. The sidebar clearly indicates 'Draft available' status in the toolbar.
Publishing Content Quickly
When reviewing a draft, editors can use the quick transition buttons in the sidebar to change states (e.g., 'Publish' or 'Archive') without navigating to the edit form. They can optionally add a custom revision log message by checking 'Use custom log message' before clicking the transition button.
Discarding Unwanted Drafts
If a draft is no longer needed, editors can click the 'Discard draft' button in the sidebar. This creates a new revision from the currently published version, effectively reverting to the live content while keeping the discarded draft in revision history for audit purposes.
Managing Multilingual Content
On multilingual sites, editors can click the 'Translate' button in the sidebar to see all available translations with their current moderation states. They can quickly view or edit existing translations, or create new translations for languages that don't have content yet.
Reviewing Revision History
For nodes, editors can click 'Show revisions' to see the last 5 revisions with their log messages, authors, and timestamps. Each revision is linked for easy viewing, and a 'View all revisions' button provides access to the complete revision history.
Hiding Administrative Transitions
Site administrators can hide certain workflow transitions from the sidebar on a per-workflow basis. For example, they might hide an 'Archive' transition that should only be performed by administrators through the full edit form, not through the quick sidebar interface.
Tips
- The color-coded status indicator in the toolbar provides at-a-glance information: green for Published, red for Draft, orange for Draft Available
- Use custom revision log messages when making significant state changes to maintain a clear audit trail
- The sidebar respects all Content Moderation permissions - users only see transitions they're allowed to perform
- Self-transitions (e.g., Draft to Draft) are automatically hidden to reduce clutter
- The sidebar works with any revisionable content entity type, not just nodes, though some features like revision history are node-specific
Technical Details
Admin Pages 1
/admin/config/user-interface/moderation-sidebar
Configure which workflow transitions should be hidden from the Moderation Sidebar. This allows site administrators to globally disable certain transitions from appearing in the sidebar for all users.
Permissions 2
Hooks 1
hook_moderation_sidebar_alter
Allows modules to alter the render array of the moderation sidebar before it is displayed. Can be used to add custom buttons, links, or information to the sidebar.
Troubleshooting 5
Verify that: 1) The user has the 'Use the Moderation Sidebar' permission, 2) You are viewing a moderated entity (not an admin page), 3) Content Moderation is enabled with at least one workflow, 4) The entity type is configured to use a moderation workflow.
Check the Moderation Sidebar settings at /admin/config/user-interface/moderation-sidebar to see if transitions have been disabled globally. Also verify that the current user has permission to perform those specific transitions in the workflow configuration.
The Translate button only appears when: 1) Content Translation module is enabled, 2) The entity type is configured for translation, 3) The user has translation permissions for the entity type.
The revisions button currently only appears for nodes (not other entity types) and requires the user to have 'view all revisions' permission for nodes.
The sidebar should automatically refresh after Quick Edit saves. If not, click the Tasks button to close and reopen the sidebar to see updated information.
Security Notes 3
- The 'administer moderation sidebar' permission is marked as restricted access and should only be granted to trusted administrators
- The sidebar respects all underlying entity access permissions - users can only perform actions they have permission to do
- Disabling transitions in the sidebar is not a security measure - it only hides the buttons from the UI. Users with appropriate permissions can still perform transitions through other means (edit form, Drush, etc.)