Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291829

Provide a way for other modules to flag block plugin implementations as 'navigation safe'

$
0
0

Problem/Motivation

In the present state of the core inclusion MR, we're missing a way for module authors to mark a Block plugin implementation as 'navigation safe', and listed for use in the Navigation admin UI (/admin/config/user-interface/navigation-block).

Steps to reproduce

As a module author, create a new Block plugin (drush gen module && drush gen block). At this point there should be a way to mark it as 'navigation safe', but there isn't on account of the core navigation module having a static list of approved blocks:

https://git.drupalcode.org/issue/drupal-3438895/-/blob/3438895-add-the-n...
https://git.drupalcode.org/issue/drupal-3438895/-/blob/3438895-add-the-n...

Proposed resolution

Provide a way for module authors to mark block plugins as 'navigation safe'.

Remaining tasks

Review.

User interface changes

None.

API changes

Modules can define their blocks as allowed in navigation in a hook_block_alter() by adding the property allow_in_navigation, like in the MR:

$definition['allow_in_navigation'] = TRUE;

This will be moved to block attributes once #3443882: Allow attribute-based plugins to discover supplemental attributes to set additional properties is merged.

Data model changes

@todo


Viewing all articles
Browse latest Browse all 291829

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>