>Remove colon from label Drupal

Posted: June 8, 2011 in Drupal

>

To remove Colon from label for form elements just add this below code in to your template.php of the active theme. And replace Theme with your theme name. You can find Original code at includes/form.inc

 
function theme_form_element($element, $value) {
  // This is also used in the installer, pre-database setup.
  $t = get_t();

  $output = '

  if (!empty($element[‘#id’])) {
    $output .= ‘ id=”‘. $element[‘#id’] .’-wrapper”‘;
  }
  $output .= “>\n”;
  $required = !empty($element[‘#required’]) ? ‘*‘ : ”;

  if (!empty($element[‘#title’])) {
    $title = $element[‘#title’];
    if (!empty($element[‘#id’])) {
      $output .= ‘ ‘. $t(‘!title !required’, array(‘!title’ => filter_xss_admin($title), ‘!required’ => $required)) .”\n”;
    }
    else {
      $output .= ‘ ‘. $t(‘!title !required’, array(‘!title’ => filter_xss_admin($title), ‘!required’ => $required)) .”\n”;
    }
  }

  $output .= ” $value\n”;

  if (!empty($element[‘#description’])) {
    $output .= ‘

‘. $element[‘#description’] .”

\n”;
  }

  $output .= “

\n”;

  return $output;
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s