Provide a way for contrib to list its own examples

Created on 20 October 2021, over 3 years ago
Updated 2 July 2024, 10 months ago

Problem/Motivation

Examples used to be displayed in a Tools menu, but this shifted to be in a Toolbar. This means that any contributed module that was providing examples no longer have a home for their examples.

Without that I might as well not require Examples as the scaffold/method of providing examples my contrib module's examples.

Steps to reproduce

1. composer require drupal/examples drupal/xero
2. Enable Examples, Xero and Xero Examples
3. Get lost because menu links no longer appear in a tools menu or in the toolbar. :*(

Proposed resolution

Add the Tools menu back or provide a way to generate routes from examples modules that's not hard-coded.

Remaining tasks

Decide on a way and implement it.

User interface changes

Provides a menu or toolbar implementation for everyone.

API changes

Probably additions.

Data model changes

Probably not.

✨ Feature request
Status

Needs review

Version

4.0

Component

Other

Created by

πŸ‡ΊπŸ‡ΈUnited States mradcliffe USA

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.

  • πŸ‡¨πŸ‡³China jungle Chongqing, China

    Let's allow contrib modules to implement hook_examples_toolbar_routes_alter() to add a menu item to the Examples toolbar.

    function hook_examples_toolbar_routes_alter(&$routes) {
      // Add a menu item for `foo_example` module to the `Examples` toolbar.
      // keyed by the module name, and the value is the route name.
      $routes['foo_example'] = 'foo_example.description';
    }
    

    See the example

  • πŸ‡¨πŸ‡³China jungle Chongqing, China
  • πŸ‡¨πŸ‡³China jungle Chongqing, China
  • First commit to issue fork.
Production build 0.71.5 2024