Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294882

Allow adding a body class in a route / controller

$
0
0

Problem/Motivation

Adding a body class in a controller to indicate for example, which type of entity or page is currently handled doesn't seem to be possible
Using hook_preprocess_html() isn't helpful as it doesn't have a good way to determine the current controller / entity.

See https://drupal.stackexchange.com/questions/210376/how-can-i-add-a-css-cl... for similar questions

So the problem in behind is to get the information from the controller into the page / html.

Maybe this should be extended to a wider context of being able to change / attach page metadata in the controller, probably through the render array?

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 294882

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>