So when on "/messages" page, there are checkboxes, however it doesn't have labels which means these checkboxes can't be styled. I'd like to suggest that labels should be added for that reason. If there's a way to do that with using form_alter or something else, i'd be reaaaally glad if someone could help with that.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

metallized’s picture

FileSize
714 bytes

Hi, here is the patch that i did to resolve this

metallized’s picture

Version: 7.x-2.x-dev » 7.x-1.4
Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 1: privatemsg.labels.patch, failed testing.

metallized’s picture

metallized’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 4: 2199403-label-for-checkboxes.patch, failed testing.

Coyote6GraphX’s picture

I agree it would be nice if this was set to display the labels by default, but you can override it using theme_tableselect() in your template.php file in your theme. No need to patch the module. Just copy the theme_tableselect() code and then after the if statement on lines 10-12:

      if (isset($element['#options'][$key]['#attributes'])) {
        $row += $element['#options'][$key]['#attributes'];
      }

add the following code:

      if (!isset ($element[$key]['#title']) || !is_string ($element[$key]['#title']) || $element[$key]['#title'] == '') {
        $element[$key]['#title'] = 'Select Item ' . $key;
      }
      $element[$key]['#title_display'] = 'after';

Took me a bit to figure this one out, and yes this will effect all table selects for your theme, but that would be the goal as you would need to be able to style all checkboxes.

ivnish’s picture

Status: Needs work » Closed (outdated)
andypost’s picture

Status: Closed (outdated) » Needs work