แก้ไขที่ .theme ใน folder Theme ของคุณ แล้ว โค้ดที่ได้จากข้างล่างนี้
(THEMENAME เปลี่ยนเป็นชื่อ Theme ของคุณเอง)
/**
* Implements hook_preprocess_html().
*/
function THEMENAME_preprocess_html(&$vars) {
// Get the current path
$current_path = \Drupal::service('path.current')->getPath();
$internal = \Drupal::service('path_alias.manager')->getAliasByPath($current_path);
// Assign it to body class
$vars['attributes']['class'][] = str_replace("/", "", $internal);
}
Comments