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 .= ' \n";
}
else {
$output .= ' \n";
}
}
$output .= " $value\n";
if (!empty($element['#description'])) {
$output .= '
'. $element['#description'] ."
\n";}
$output .= "
return $output;
}
Thanks for your post, but this do not work for me..i'm trying to hide colon of all field label, in drupal 7, for a specific content-type..
ReplyDeleteyour code have some syntax error (i tried to fix it, but seems wrong). Can you fix it?
Thanks in advance
HI Macro,
ReplyDeleteI used this code in Drupal 6. I don't know whether it will work in Drupal 7.
I will try to change this code as per Drupal 7 format.
Hi Macro,
ReplyDeleteIn Drupal 7, Content type fields does not contains Colon
drupal has a no colons module and in D8 there is a checkbox for this in core for each field
ReplyDelete