Patch adds wrapper class with even/ odd on panes in a region. This allows creating "stripped" panes.

Comments

merlinofchaos’s picture

Status: Needs review » Needs work

Sorry it's taken me so long to get to this:

1) What about adding the row class to $pane->css_class instead of adding another div just for the striping?

2) Let's call the style 'Striped'

3) Let's remove the reference to the 'Tabs' style int he doc :)

amitaibu’s picture

> What about adding the row class to $pane->css_class instead of adding another div just for the striping?

If I'm not mistaken if you add $pane_css_class via code and a user adds CSS class via UI, the UI overrides the code, that's why I used the wrapping <div>

amitaibu’s picture

edit: double post

amitaibu’s picture

> Sorry it's taken me so long to get to this:

No problem,good to see you back in the issue queue :)

merlinofchaos’s picture

You could always append it to pane_css with a space.

amitaibu’s picture

Status: Needs work » Needs review
StatusFileSize
new2.08 KB

Patch adds class to $pane->css via hook_panels_pane_content_alter().

There is a todo referencing #1230324: Pass $display in hook_panels_pane_content_alter or cache $display
Note that also here we are bitten by the missing $display->did, in case the page is exported:/

watchdog’s picture

This can actually easily be accomplished in template.php

/**
 * Add odd/even classes to panel panes
 */
function themename_preprocess_panels_pane(&$vars) {
  $vars['classes_array'][] = $vars['zebra'];
}
michelle’s picture

Issue summary: View changes
StatusFileSize
new1.96 KB

I tested the patch in #6. It applies cleanly and works. The issue in the TODO has been committed so I made the change based on that and got rid of the TODO section. This is the change that was committed:

- $function($content, $pane, $this->display->args, $this->display->context);
+ $function($content, $pane, $this->display->args, $this->display->context, $this, $this->display);

I'm not 100% what "$this" is but it seemed like "renderer" made sense so I used that for the parameter. If I'm wrong, that needs to be changed.

Leaving at Needs Review since I made changes.

dremy’s picture

@Michelle I just tested patch #8 first on a local build, then on simplytest.me with a clean build and couldn't replicate that this patch works. #7 does work.

japerry’s picture

Status: Needs review » Closed (outdated)

Drupal 7 is no longer supported, closing.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.