Skip to content
Kelly Rock edited this page Apr 4, 2026 · 8 revisions

Add Content Dropdown Block

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

✨ Features

  • ✅ Role-aware (respects create {type} content permissions)
  • ✅ Configurable content types per block instance
  • ✅ Customizable button label
  • ✅ Lightweight and dependency-free (uses core APIs)
  • ✅ Cache-safe (user.permissions context)

📸 Screenshot

Add Content Dropdown

Example of the dropdown block displayed on an admin dashboard.


📥 Installation

  1. Place the module in:
/modules/custom/add_content_dropdown_block
  1. Enable the module:
drush en add_content_dropdown_block -y
  1. Clear cache:
drush cr

⚙️ Usage

  1. Go to:
Structure → Block Layout
  1. Place the block:
Addcontentdropdown
  1. Configure:
  • Select which content types to include
  • Set a custom button label (e.g. + Add Content)
  1. Save and view on your admin page

🧠 How It Works

The block:

  1. Loads all node bundles
  2. Filters based on selected content types
  3. Checks permissions:
create {content_type} content
  1. Builds a dropdown of allowed links

🧩 Example Output

+ Add Content
  - Add Article
  - Add Page
  - Add Event

Only content types the user has permission to create will appear.


🚀 Future Improvements

  • Dropdown styling (Gin / Claro integration)
  • Toolbar integration (admin shortcut)
  • Role-based configuration presets
  • Icons per content type
  • AJAX loading for large sites

🛠 Requirements

  • Drupal 10+
  • Node module (core)

👨‍💻 Author

Built as a reusable admin UX improvement module for Drupal dashboards.


📁 Add the Screenshot File

Create this path in your repo:

/docs/screenshot.png

Use the image you generated earlier (or export it), and name it:

screenshot.png

👍 Pro tip

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