-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Kelly Rock edited this page Apr 4, 2026
·
8 revisions
A Drupal 10 custom module that provides a role-aware “Add Content” dropdown block for admin dashboards.
This block dynamically displays links to create content based on:
- Selected content types
- Current user permissions
- ✅ Role-aware (respects
create {type} contentpermissions) - ✅ Configurable content types per block instance
- ✅ Customizable button label
- ✅ Lightweight and dependency-free (uses core APIs)
- ✅ Cache-safe (
user.permissionscontext)

Example of the dropdown block displayed on an admin dashboard.
- Place the module in:
/modules/custom/add_content_dropdown_block
- Enable the module:
drush en add_content_dropdown_block -y
- Clear cache:
drush cr
- Go to:
Structure → Block Layout
- Place the block:
Addcontentdropdown
- Configure:
- Select which content types to include
- Set a custom button label (e.g.
+ Add Content)
- Save and view on your admin page
The block:
- Loads all node bundles
- Filters based on selected content types
- Checks permissions:
create {content_type} content
- Builds a dropdown of allowed links
+ Add Content
- Add Article
- Add Page
- Add Event
Only content types the user has permission to create will appear.
- Dropdown styling (Gin / Claro integration)
- Toolbar integration (admin shortcut)
- Role-based configuration presets
- Icons per content type
- AJAX loading for large sites
- Drupal 10+
- Node module (core)
Built as a reusable admin UX improvement module for Drupal dashboards.
Create this path in your repo:
/docs/screenshot.png
Use the image you generated earlier (or export it), and name it:
screenshot.png
If you want this to look more “official” on GitHub:
- Add badges (Drupal version, license)
- Add a GIF demo instead of static screenshot
- Rename repo to:
drupal-add-content-dropdown-block
Test