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.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 1618152-2-fieldable_panels_panes_classes.patch | 305 bytes | grndlvl |
| #1 | fieldable-panels-panes-preprocess-1618152-1.patch | 2.12 KB | dalin |
Comments
Comment #1
dalinThis patch is possibly an improvement. However I'm not sure if we can more fully utilize the render array that's already there.
Comment #2
merlinofchaos commentedI 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.
Comment #3
grndlvl commentedWouldn'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
Comment #4
dave reidTested and committed a modified version of #3 that also supports $variables['attributes'] as well. http://drupalcode.org/project/fieldable_panels_panes.git/commit/5c3b3a0
Comment #5
dalin@Dave, not sure that you wanted that 'test' in there
Comment #6
dave reidOops, thanks I'll fix that.
Comment #7
dave reidFixed. http://drupalcode.org/project/fieldable_panels_panes.git/commit/a3269de
Comment #8
dave reid