Block module changes
- Block module is no longer responsible for page layouts, and as such most of its administration pages have been removed, including configuring blocks (other than custom block content), node type conditionals, path-based display, and role-based display. These are replaced by Layout block conditions (supporting these options and more, such as language conditions).
- Block module's tables for block, block_role, and block_node_type no longer exist.
hook_block_view()now receives two additional arguments for
$settingsand $contexts, allowing per-block configuration and different contexts per block (no more node_load(arg(1)))
hook_block_info()may now specify "required contexts" as an array.
hook_block_save()now takes the
$editparameter by reference. Settings no longer have to be saved manually into variables. The contents of the
$editarray will be saved into the layout configuration.
block_custom_block_load() to allow for menu loading.
$page variable has been removed
$page renderable is gone, as are hook_page_build() and hook_page_alter(). There are no full replacements for these hooks, as the page is now built by layouts. There is no longer the ability to manually move a block from one location on the page to another via hook, but the flexibility of Layouts makes this unnecessary. In the land of Layouts, you would simply add a new layout that had the blocks in the right place. Modules currently using hook_page_build/alter() usually did so to add JS or footers to the page, which can be done via hook_preprocess_page().
See the example in Admin Menu
$page renderable no longer exists, we need a new way to disable messages during BatchAPI. Previously, this was done by setting
$page['#show_messages'] = FALSE. Now we have a replacement function
backdrop_display_messages(FALSE) that will hide (or show) messages for a page request.
Backdrop/drupal_set_page_content() no longer exists, which added blocks to a region. Although not encouraged, this may be done with hook_preprocess_layout() to add blocks to a region outside the normal Layout flow.
Menu access callbacks
Menu access callbacks may now be in separate .inc files instead of in the main module.
Support for "base hooks"
Support for "base hooks" in the theme now call the preprocess functions of the base hooks. e.g. System module specifies the template "block--system--main.tpl.php", which is a suggestion of the Layout module "
template_preprocess_block() would not be called for this suggestion. Now,
template_preprocess_block() is called, followed by the suggestion of
template_preprocess_block__system__main() (if it existed).
Body classes are not longer added based on sidebars
Body classes are not longer added based on sidebars (e.g.
No automatic path-based suggestions for page templates
Page templates no longer have automatic path-based suggestions (e.g.
page--node-1.tpl.php). Instead create separate layouts or if needed, recreate the suggestion via
New header.tpl.php file
Page variable changes
Moved to layout.tpl.php:
$content(contains all regions)
Added to everything
Now part of header block:
Move to separate blocks:
$feed_icons(use the node syndicate block)
$secondary_menu(place as a normal menu block)