Problem/Motivation

For a themer and potentially others, route name discoverable would be preferable over paths and making routes easier is key to this.

Proposed resolution

When twig_debug is turned on (or other debug/development variable), inject the page's route into a comment in the page template.

Remaining tasks

Create a patch to inject the page's route if available when twig_debuging.

User interface changes

n/a

API changes

n/a

Comments

dawehner’s picture

Would that information be print out in the beginning of the HTML, so for example in the page_top / page_bottom variable?
Just curious where you would expect it to be in general.

In general this is really a good idea!

joelpittet’s picture

My initial thought was 'page_top' but either or would be good. scripts bottom come after page_bottom so it wouldn't be as easy to just scroll to bottom.

dawehner’s picture

Yeah the question is where would themers look at it.

In general the https://drupal.org/project/webprofiler already solves that problem in a different and more advanced
way, but for core this is a nice and simple improvement.

joelpittet’s picture

@dawehner asking around a bit.

Fabianx’s picture

I think we could just add it to either the page.html.twig or the html.html.twig at the top - near the twig debug output ...

That is where I would search for it ...

joelpittet’s picture

Version: 8.0.x-dev » 8.1.x-dev
Category: Task » Feature request
Status: Active » Postponed
dawehner’s picture

Just as alternative idea, we could try to bring the webprofiler module with 8.1.x into core ...

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

joelpittet’s picture

Status: Postponed » Active

Doesn't need to be postponed any longer, could go into contrib

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.