Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Please add the following to the template.php code.
This will bring back all the nice body classes in v6.
Best
Ben
function basic_preprocess_html(&$vars) {
global $user;
foreach ($user->roles as $role){
//Add role name classes (to allow css based show for admin/hidden from user)
$vars['classes_array'][] = basic_id_safe($role);
}
if (!$vars['is_front']) {
// Add unique classes for each page and website section
$path = drupal_get_path_alias($_GET['q']);
list($section, ) = explode('/', $path, 2);
$vars['classes_array'][] = 'with-subnav';
$vars['classes_array'][] = basic_id_safe('page-'. $path);
$vars['classes_array'][] = basic_id_safe('section-'. $section);
//dvm($vars['classes_array']);
if (arg(0) == 'node') {
if (arg(1) == 'add') {
if ($section == 'node') {
array_pop( $vars['classes_array'] ); // Remove 'section-node'
}
$vars['classes_array'][] = 'section-node-add'; // Add 'section-node-add'
}
elseif (is_numeric(arg(1)) && (arg(2) == 'edit' || arg(2) == 'delete')) {
if ($section == 'node') {
array_pop( $vars['classes_array']); // Remove 'section-node'
}
$vars['classes_array'][] = 'section-node-'. arg(2); // Add 'section-node-edit' or 'section-node-delete'
}
}
}
if ((arg(0) == 'node') && (arg(2) == 'edit')) { //for normal un-themed edit pages
$vars['template_files'][] = 'page';
}
}
Comments
Comment #1
SteveK CreditAttribution: SteveK commentedthanks. added this into 3.x branch.
Comment #2
BenMirkhah CreditAttribution: BenMirkhah commentedGreat, while at it thanks for this wonderful theme,
been using it for years and it's my favorite.