Menus

Menus are configuration entities represented by the following class: DrupalsystemEntityMenu. I mentioned in Chapter 1, Developing for Drupal 8, that we have something called configuration entities in Drupal 8, which we will explore in detail later in this book. However, for now, it's enough to understand that menus can be created through the UI and become an exportable configuration. Additionally, this exported configuration can also be included inside a module so that it gets imported when the module is first installed. This way, a module can ship with its own menus. We will see how this latter aspect works when we talk about the different kinds of storage in Drupal 8. For now, we will work with menus that come with Drupal 8 core.

Each menu can have multiple menu links, structured hierarchically in a tree with a maximum depth of 9. The ordering of the menu links can be done easily through the UI or via the weighting of the menu links, if defined in code.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset