Download & Extend

Improve the documentation and naming of hook_block_view_alter() hooks

Project:Drupal core
Version:8.x-dev
Component:documentation
Category:task
Priority:normal
Assigned:Unassigned
Status:active
Issue tags:Block plugins, Blocks-Layouts

Issue Summary

Problem/Motivation

This is a followup issue for #1535868: Change notice: Convert all blocks into plugins.

  • hook_block_view_ID_alter() and hook_block_view_NAME_alter() currently have the same documented example in block.api.php.
  • It is unclear from the documentation what ID and NAME represent.

Proposed resolution

  • Improve the documentation to clarify the different uses of the two hooks.
  • Provide differing, plausible example implementations for each.
  • Consider renaming the hooks to use more explicit tokens than ID and NAME.
  • Include example hook names in the documentation.

Comments

#1

#2

Status:postponed» active

#3

Issue tags:+Block plugins

#4

#5

See also #1892472-8: Document hook_block_access -- apparently some of the parameters in these functions are using the wrong class names?

nobody click here