This module was just what I needed to quickly gather some information on when members were available for certain things, using the columns as days of the week, rows as time of day, and cells as all check-boxes. However, the display wasn't what I was looking for, as I just wanted the display to be "Monday morning, Wednesday afternoon, Friday evening." The existing display just gives the matrix back with "Yes" and "No", which visually isn't all that great IMHO, particularly when those values can't be styled.

So, the attached patch does a couple of things:

  1. It wraps the "Yes" and "No" values of the standard display in "matrix-yes" and "matrix-no" classes via tags, so they can be styled (such as making the display for the "No" values 'none' and replacing the "Yes" values with a check-mark graphic via a background-image and making the text not visible).
  2. It introduces two new display formatters (which in reality use the same base function), one for column-major order, and one for row-major order. These are combined with three new settings on the configuration for the fields that allow for specification of major and minor separators and any trailing characters (such as a period). The result is a list as noted above based on checked cells.

Would be great if this made it into the next release. :-)

Note, once you apply the patch, you'll have to clear your Drupal caches for the new bits to work.

CommentFileSizeAuthor
6.x-2.0-alpha1-cbd-2010-08-21.patch9.02 KBsdsheridan

Comments

chinita7’s picture

Thank you for this patch this was exactly what I was looking for. I tried it on 6.2 alpha1 version and works perfect.
Hope this will be implemented in 6.2 version.

chinita7’s picture

Version: 6.x-2.0-alpha1 » 6.x-2.x-dev

I just tried it on the 6.dev version as it seems to be integrated with Views.
However It says "Hunk #3 FAILED at 313" and the rest of the parts are successfully done.

So I tried patch manually only Hunk#3 part but couldn't figure out what to change as the lines don't match between the patch and the dev version . I thinks this part bellow is Hunk#3 but I don't know where to put them as I'm not a coder.
Any idea? Thanks in advance.

       $values['rows_elements'] = $field['rows_elements'];
       $values['cols_elements'] = $field['cols_elements'];
       $values['mode'] = $field['mode'];
+      $values['checkbox_summary_major_sep'] = $field['checkbox_summary_major_sep'];
+      $values['checkbox_summary_minor_sep'] = $field['checkbox_summary_minor_sep'];
+      $values['checkbox_summary_end'] = $field['checkbox_summary_end'];
       $additions = array($field['field_name'] => $values);
       return $additions;
      case 'update':
intrafusion’s picture

Status: Active » Closed (won't fix)