Change record status: 
Project: 
Introduced in branch: 
8.0.x
Introduced in version: 
8.0.0-beta1
Description: 

In Drupal 7 and older, primary and secondary links (menus) have always been handled differently than other menus. Primary and secondary links are intended to display important links that are featured in themes. This led to an architecture supporting the primary and secondary links that became rigid and hardwired in its implementation, because it was closely intertwined with themes.

In Drupal 8, primary and secondary links have become unspecialized. They have been converted to blocks and are now managed just like any other block. A theme can still choose to provide "primary and secondary links" functionality, by adding the "Primary menu" (primary_menu) and "Secondary menu" (secondary_menu) regions. These regions are intended to be used by only a single block at a time, and only by menu blocks (just like the names suggest). This is what the default page.html.twig does (which custom themes inherit unless they overrides it) and what the default front-end theme — Bartik — also does.

API changes

  • The primary and secondary menus are converted into blocks, and therefore no longer available as theme settings or as variables in the page template.
  • The following API functions are removed:
    • function menu_main_menu()
    • menu_secondary_menu()
    • _menu_get_links_source()
    • menu_navigation_links()
  • The primary and secondary menu settings are removed from menu_ui.settings and theme.settings.
  • Two new regions in Bartik: primary_menu and secondary_menu.
Impacts: 
Site builders, administrators, editors
Module developers
Themers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done

Comments

Anonymous’s picture

This part of the new design just does not make any sense to me.

A theme can still choose to provide "primary and secondary links" functionality, by adding the "Primary menu" (primary_menu) and "Secondary menu" (secondary_menu) regions. These regions are intended to be used by only a single block at a time, and only by menu blocks (just like the names suggest).

I mean either we go all in with the design change or not.

patelsachin444’s picture

It means that for D8 it is not necessary to print the primary menu and secondary menu in page.html.twig as we do for D7. In D8 primary and secondary menu are available as blocks "Main Navigation & User account Menu" respectively. You can choose where to display the menu from block settings.