After fixing #1048792: Find out why browser class module doesn't work with LayoutStudio I discovered that Drupal core is providing several body classes that we appear to be duplicating. We should (determine whether we can) remove any of our body classes that are indeed duplicates.

Comments

rjay’s picture

Title: Determine whether we can remove any of our body classes that are already being added by Drupal core » Remove any of our body classes that are already being added by Drupal core
theshanergy’s picture

Status: Active » Needs review

Further to this, the whole 'section' class in layoutstudio is broken right now..

this whole chunk of code:

  if (!$variables['is_front']) {
		// Add unique classes for each page and website section
		$path = drupal_get_path_alias($_GET['q']);
    $section = arg(0);
    $sub_section = arg(1);
		$variables['classes_array'][] = 'section-'. $section;
		$variables['classes_array'][] = 'sub-section-'. ($sub_section ? $sub_section : 'none');
		if (arg(0) == 'node') {
			if (arg(1) == 'add') {
				if ($section == 'node') {
					array_pop($variables['classes_array']); // Remove 'section-node'
					array_pop($variables['classes_array']); // Remove 'section-node'
				}
				$variables['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($variables['classes_array']); // Remove 'section-node'
					array_pop($variables['classes_array']); // Remove 'section-node'
				}
				$variables['classes_array'][] = 'section-node-'. arg(2); // Add 'section-node-edit' or 'section-node-delete'
			}
		}
	}

can become:

  if (!$variables['is_front']) {
		// Add unique classes for each page and website section
		$path = explode('/', drupal_get_path_alias($_GET['q']));
		$variables['classes_array'][] = 'section-'.$path[0];
		if(isset($path[1])) {
			$variables['classes_array'][] = 'sub-section-'.$path[1];
		}
	}

that will fix the duplication of core while adding the every so handy alias class to the body - core only uses arg().. which is what this function was using before as well

rhache’s picture

Status: Needs review » Fixed

From what I can tell, this is all fixed in the latest release.

Thanks,
Rene

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.