In my case I just want to add an additional class to the container div

$vars['classes_array'][] = 'my-class';

However this is not possible since fieldable_panels_panes_preprocess_fieldable_panels_pane() seems to want to short-circuit the normal rendering process.

Comments

dalin’s picture

Status: Active » Needs review
StatusFileSize
new2.12 KB

This patch is possibly an improvement. However I'm not sure if we can more fully utilize the render array that's already there.

merlinofchaos’s picture

Status: Needs review » Needs work

I don't think this is actually the right way to go about it. For one, you'll end up with even more nested divs that are unnecessary.

I think we want classes to be a separate variable.

That said, I think we also expect people to use template_preprocess_panels_pane instead and add classes to the pane wrapper, which is a much more normal place to put things. For example, that's the only place you can affect the title.

grndlvl’s picture

Status: Needs work » Needs review
StatusFileSize
new305 bytes

Wouldn't we just use the $classes variable by default since it's classes_array is turned into $classes in template_process?

http://api.drupal.org/api/drupal/includes!theme.inc/function/template_process/7

dave reid’s picture

Status: Needs review » Fixed

Tested and committed a modified version of #3 that also supports $variables['attributes'] as well. http://drupalcode.org/project/fieldable_panels_panes.git/commit/5c3b3a0

dalin’s picture

Priority: Normal » Major
Status: Fixed » Needs work

@Dave, not sure that you wanted that 'test' in there

div class="test <?php print $classes; ?>"<?php print $attributes; ?>>
dave reid’s picture

Oops, thanks I'll fix that.

dave reid’s picture

dave reid’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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