Problem/Motivation

Switching from theme functions to Twig templates in Drupal 8 was a big step forward to make customization of Drupal's HTML output much simpler. Most of the time a Twig template is easy to understand and so it is easy to customize.

The menu_links macro (currently) contained by menu.html.twig file is fairly complex however. Although I was able to customize it to my needs after some investigation I think it is not possible to--perfectly--understand what happens in this code without a massive developer knowledge.

Proposed resolution

Write a line by line explanation of the macro in the drupal.org documentation. I've just created a page for this: https://www.drupal.org/node/2717173

Remaining tasks

Write the documentation.

User interface changes

-

API changes

-

Data model changes

-

Comments

thamas created an issue. See original summary.

jhodgdon’s picture

Title: Write documentation of menu_links macro » Write documentation of menu_links template
Project: Drupal core » Documentation
Version: 8.2.x-dev »
Component: documentation » Missing documentation
Category: Support request » Task

This is not a Drupal Core issue. Moving to Documentation project.

thamas’s picture

@jhodgdon Thanks for the corrections! Maybe the title should be set back because the template is called to menu.html.twig and the macro inside it is called to menu_links.

Also the macro is may be moved to an other template as it can be read in #2490308: Refactor the macro on menu.html.twig for reusability

thamas’s picture

Title: Write documentation of menu_links template » Write documentation of menu_links macro
avpaderno’s picture

Title: Write documentation of menu_links macro » Write documentation for the menu_links macro