panel-pane class omitted, breaks styles.

brianmercer - October 17, 2009 - 04:12
Project:Panels
Version:6.x-3.1
Component:Panel pages
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

When no custom css classes are assigned to a pane through the panels interface and the Style is set to No Style, a panel-pane class is assigned to one of the pane's wrapping divs.

However, if custom classes are assigned or skinr classes are assigned, the panel-pane class is not added to the classes of the wrapping div.

The hidden admin-links hover links depend on the panel-pane class to hide themselves. i.e.

div.panel-pane div.panel-hide {
  display:none;
}

A workaround is to add the panel-pane class manually to the custom classes.

#1

Deciphered - October 18, 2009 - 21:35
Title:When custom css classes are assigned the panel-pane class is omitted and unhides admin-links» panel-pane class omitted, breaks styles.
Priority:minor» normal

I also noted this when I upgraded (10 minutes ago), and not only does the 'panel-pane' class get omitted, but it still puts a space before the user defined class, implying that the 'panel-pane' class isn't supposed to be omitted.

This is, while not a critical issue, an extremely annoying issue as it breaks all my css relying on this rule. Not something one would expect for a point release.

#2

Deciphered - October 18, 2009 - 21:46

The issue is is on line #1020 of 'panels.module':

This:
      $vars['classes'] = ' ' . $content->css_class;

Should be this:
      $vars['classes'] .= ' ' . $content->css_class;

Whether this is intentional for some unknown (to myself) reason, or a simple error, I am unsure, but the change fixes things for me.

Also, apologies for not supplying a patch, but my current workstation has restrictions in place that do not allow me to do so.

Cheers,
Deciphered.

#3

Deciphered - October 18, 2009 - 21:46
Status:active» needs review

Forgot to set status.

#4

sethfreach - October 20, 2009 - 15:06
Status:needs review» reviewed & tested by the community

patch attached for Deciphered's fix. I tested this quickly and it works for my sites.

AttachmentSize
panels.module.patch 648 bytes

#5

merlinofchaos - October 21, 2009 - 20:23
Status:reviewed & tested by the community» fixed

Committed to -dev. Feeling somewhat red-faced over that stupid typo.

#6

iaminawe - October 26, 2009 - 09:33
Status:fixed» active

I have downloaded latest dev of ctools and panels 3
I have cleared all caches and refreshed a few times

I still have this issue with my panels and I checked to see and in panels.module the typo has been corrected.

I have also tried resaving the panel layouts that I wan't the css to show up on and still no luck

Strangely, Panel pane CSS classes are picked up in one theme I have running (based on Acquia Marina) but in the new one I am developing (based on Zen), Panel pane CSS is being entirely ignored.

Any ideas why this could be?

Thanks in advance

Re-opened this issue, if you feel this a new one please re-close and I will start a new thread.

#7

merlinofchaos - October 26, 2009 - 17:27

If it works in one theme but not the other I would look to see if you have an override or a preprocess that's doing something?

#8

iaminawe - October 28, 2009 - 10:36

Hi Merlin

Thanks for the advice... I checked my template file and removed

if ($vars['node']->type == 'panel') {
$vars['template_file'] = 'page-panel';
}

which was from an earlier attempt at using a .tpl with a panel.

This is my preprocess page function... see anyhting fishy in there

function themename_preprocess_page(&$vars, $hook) {
// For easy printing of variables.
$vars['logo_img'] = $vars['logo'] ? theme('image', substr($vars['logo'], strlen(base_path())), t('Home'), t('Home')) : '';
$vars['linked_logo_img'] = $vars['logo_img'] ? l($vars['logo_img'], '', array('rel' => 'home', 'title' => t('Home'), 'html' => TRUE)) : '';
$vars['linked_site_name'] = $vars['site_name'] ? l($vars['site_name'], '', array('rel' => 'home', 'title' => t('Home'))) : '';
$vars['main_menu_links'] = theme('links', $vars['primary_links'], array('class' => 'links main-menu'));
$vars['secondary_menu_links'] = theme('links', $vars['secondary_links'], array('class' => 'links secondary-menu'));

// Generate menu tree from source of primary links
$vars['primary_links_tree'] = menu_tree(variable_get('menu_primary_links_source', 'primary-links'));

// Make sure framework styles are placed above all others.
$vars['css_alt'] = designindaba_css_reorder($vars['css']);
$vars['styles'] = drupal_get_css($vars['css_alt']);

// This line of code was borrowed from conditional_style module (http://drupal.org/project/conditional_styles)
$vars['styles'] .= $vars['conditional_styles'] = variable_get('conditional_styles_' . $GLOBALS['theme'], '');

// Classes for body element. Allows advanced theming based on context
// (home page, node of certain type, etc.)
$classes = split(' ', $vars['body_classes']);

if (theme_get_setting('themename_debug')) {
$classes[] = 'show-grid'; // Optionally add the wireframes style.
}

$vars['body_classes_array'] = $classes;
$vars['body_classes'] = implode(' ', $classes); // Concatenate with spaces.

}

I did find this one from Zen... could this be messing with it?

I removed this

 
 

Drupal is a registered trademark of Dries Buytaert.