I'm used to have a current user language and a node ID classes on body.
I'v found this solution, is there a better way?
Thank's
>> On my customtheme.theme file:
function customtheme_preprocess_html(&$variables) {
if ($node = \Drupal::request()->attributes->get('node')) {
$variables['attributes']['class'][] = 'page-node-' . $node->id();
}
$variables['attributes']['class'][] = \Drupal::languageManager()->getCurrentLanguage()->getId();
}
>> On html.html.twig
{%
set body_classes = [
logged_in ? 'user-logged-in',
not root_path ? 'path-frontpage' : 'path-' ~ root_path|clean_class,
path_info.args ? 'path-' ~ path_info.args,
node_type ? 'page-node-type-' ~ node_type|clean_class,
db_offline ? 'db-offline',
]
%}
Thank's for all