This patch will show "title2" in the left, middle and right. For example:

slider

To enable it, just use this code:

    '#title2' => array(
      '#left' => 'LEFT',
      '#middle' => 'MIDDLE',
      '#right' => 'RIGHT',
    ),

If '#title2' is a string, nothing changes.

Patch is attached.

CommentFileSizeAuthor
align.patch1.98 KBdanithaca
slider.png10.52 KBdanithaca
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

haggins’s picture

I think there's something wrong with your patchfile, isn't it?

danithaca’s picture

The previous patch was an outdated one. Here's the code to add/replace in function _sliderfield_element_sliderfield_structure()

  if ($element['#title2']) {
    if (is_array($element['#title2'])) {
      $element['title2'] = array(
        '#type' => 'container',
        '#attributes' => array(
          'style' => 'display:block; clear:both;',
        ),
        'left' => array(
          '#type'   => 'html_tag',
          '#tag' => 'div',
          '#value' => empty($element['#title2']['#left']) ? ' ' : $element['#title2']['#left'],
          '#attributes' => array(
            'style' => 'float:left; width:30%; text-align:left',
          ),
        ),
        'middle' => array(
          '#type'   => 'html_tag',
          '#tag' => 'div',
          '#value' => empty($element['#title2']['#middle']) ? ' ' : $element['#title2']['#middle'],
          '#attributes' => array(
            'style' => 'float:left; width: 40%; text-align:center;',
          ),
        ),
        'right' => array(
          '#type'   => 'html_tag',
          '#tag' => 'div',
          '#value' => empty($element['#title2']['#right']) ? ' ' : $element['#title2']['#right'],
          '#attributes' => array(
            'style' => 'float:left; width:30%; text-align:right;',
          ),
        ),
      );
    }
    else {
      $element['title2'] = array(
        '#type'   => 'item',
        '#markup' => '<label>' . $element['#title2'] . '</label>'
      );
    }

Anyone can review this so it's easier for the maintainer to add it?

danithaca’s picture

sinasalek’s picture

Seems useful , will review it the first change it got