All Views labels currently get a colon at the end. This may be an issue if the label has to go in a question form. How can I get rid of the colon?

Thanks!

Comments

dawehner’s picture

zualas’s picture

Finally was able to find that to be a simple theming question:

Copy the file views-view-fields.tpl.php from /modules/views/theme/ into your theme folder and replace the content with:


<?php foreach ($fields as $id => $field): ?>
  <?php if (!empty($field->separator)): ?>
    <?php print $field->separator; ?>
  <?php endif; ?>

  <<?php print $field->inline_html;?> class="views-field-<?php print $field->class; ?>">
    <?php if ($field->label): ?>
      <label class="views-label-<?php print $field->class; ?>">
        <?php print $field->label; ?>
      </label>
    <?php endif; ?>
      <?php
      // $field->element_type is either SPAN or DIV depending upon whether or not
      // the field is a 'block' element type or 'inline' element type.
      ?>
      <<?php print $field->element_type; ?> class="field-content"><?php print $field->content; ?></<?php print $field->element_type; ?>>
  </<?php print $field->inline_html;?>>
<?php endforeach; ?>

Just had to remove the colon from label output.

iko’s picture

You don't need to alter template files, unless you want this behaviour to be default. You may check the "rewrite the output of this field" box and set Label [token] as output. Copying the template files in the theme folder will prevent your site from being up-to-date if the original file is altered by module's maintainers.

charles belov’s picture

For example:

Under Rewrite the output of this field, enter into the Text field:

to [field_time_value2]

Also, set Label to none.