By wim leers on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.0.x
Introduced in version:
8.0.0-beta3
Description:
In Drupal 7 and in Drupal 8 before this change, it was possible for any module to make dynamic page alterations, thereby implicitly allowing arbitrary dynamic page alterations and easily breaking cacheability.
There are only two valid use case of dynamically adding things to the final page:
- assets that aren't associated with a specific bit of content, but with the entire page (think in-place editing)
- adding things to the special
page_topandpage_bottom"regions", which is used by e.g. Toolbar and the Block demonstration page
Before
You could change $page['content'] (or, generally speaking, $page[$region_name]) into something completely different.
Available hooks:
hook_page_build()hook_page_alter()
After
You no longer can change $page['content'] (or, generally speaking, $page[$region_name]) into something completely different.
Available hooks:
Impacts:
Module developers
Themers