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.

CommentFileSizeAuthor
#4 panels.module.patch648 bytessethfreach

Comments

deciphered’s picture

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.

deciphered’s picture

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.

deciphered’s picture

Status: Active » Needs review

Forgot to set status.

sethfreach’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new648 bytes

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

merlinofchaos’s picture

Status: Reviewed & tested by the community » Fixed

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

iaminawe’s picture

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.

merlinofchaos’s picture

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?

iaminawe’s picture

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

magnestyuk’s picture

For me no css id or class would show up. A closer look at the debated code in panels.module reveals that it first checks to see if there is content in that certain pane. Now, I sometimes use custom content panes for headings, etc., where I leave the body of the content empty and fill in only the title. As soon as I tried and put something into the body textarea, boom, the css id and class were showing up as expected. Maybe the body textarea should go with a *required mark, or the $content->content check removed from the code. Thoughts?

merlinofchaos’s picture

The content check is absolutely necessary. Most of the time you want panes without content to not appear.

merlinofchaos’s picture

Is anyone else having this problem? So far as I have seen, this is actually working for all the tests I have tried.

merlinofchaos’s picture

Status: Active » Postponed (maintainer needs more info)
savinsur’s picture

Not sure if this is what you are talking about but;

I am using views to create node information. If I use the default settings (no block or page layout)
and save the view, when I go to Panels, add new content, grab the node info (eg: node, node title)
add css properties to the node element I am adding, there is no joy seeing the css class tag on the web page.

If I do the same thing but add a CONTENT layout in views, then I can add CSS info, it all works & life is good.

esmerel’s picture

Status: Postponed (maintainer needs more info) » Fixed

Original problem corrected in patch. If this is still a problem (which I suspect it is not, given the lack of updates), please open a new issue.

Status: Fixed » Closed (fixed)

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