You can check the example from this url;

http://www.hecatomber.org/film_incelemeleri/rang_de_basanti

in the page;

"Yönetmen, Tür, Oyuncular, Dil" are autocomplete fields which can allow multiple inputs.

All i want is to make those links "comma separated"

as you can see; "Yönetmen, Tür, Dil" are viewed as text and they are comma separated.

But the "oyuncular" field is chosen to be viewed as link, and instead of comma it has a
tag between.

How can i overcome this problem?

Comments

korayal’s picture

edit: But the "oyuncular" field is chosen to be viewed as link, and instead of comma it has a <br /> tag between.

korayal’s picture

Status: Active » Closed (fixed)

Found the answer on content_taxonomy.module

changed the line 199 to;

$output .= l($term->name, taxonomy_term_path($term), array('rel' => 'tag', 'title' => $term->description)) .", ";;

chadchandler’s picture

This was very helpful. Please move this over to the Content taxonomy module as this has nothing to do with Contemplate :)

Raving’s picture

Project: Content Templates (Contemplate) » Content Taxonomy
manoloka’s picture

For some reason I don't understand the line numbers mentioned never match my line numbers ????

Anyway, just wondering if 199 is supposed to be

return implode('<br />', $terms);

(for me the above is 208)

korayal’s picture

can it be because of the message dates?

manoloka’s picture

can it be because of the message dates?

I don't know, maybe . . . but don't worry about that.

What I need to know is if

return implode('<br />', $terms);

is the bit to be replaced by

$output .= l($term->name, taxonomy_term_path($term), array('rel' => 'tag', 'title' => $term->description)) .", ";;

is it?

manoloka’s picture

can it be because of the message dates?

I don't know, maybe . . . but don't worry about that.

What I need to know is if

return implode('<br />', $terms);

is the bit to be replaced by

$output .= l($term->name, taxonomy_term_path($term), array('rel' => 'tag', 'title' => $term->description)) .", ";;

is it?

thanks

ckng’s picture

Instead of modifying module, this is the proper way to theme CCK field, including content taxonomy

- Place the modules/cck/theme "field.tpl.php" and "template.php" files in your theme's folder. If you already have a "template.php" file, you will need to append the code in this one to your own.
- Add a new file "field-field_myterm.tpl.php" where field_myterm is the CCK field name, with the following code

<div class="field field-type-<?php print $field_type_css ?> field-<?php print $field_name_css ?>">
  <?php if ($label_display == 'above') : ?>
    <div class="field-label"><?php print $label ?>:&nbsp;</div>
  <?php endif;?>
  <div class="field-items">
    <?php
      $terms = array();
    
      foreach ($items[0] as $key => $term) {
        if (!is_object($term) && $key == 'value' && is_numeric($term) && $term != 0) {
          $term = taxonomy_get_term($term);
        }
        if (!empty($term->name)) {
          $terms[] = l($term->name, taxonomy_term_path($term), array('rel' => 'tag', 'title' => strip_tags($term->description)));
        }
      }
      print implode(', ', $terms);
    ?>
  </div>
</div>
abaddon’s picture

there is a simpler fix from the theme, see http://drupal.org/node/134306#comment-2622670