It appears that Views 2 allows for Fields to be displayed inline. However, i can't figure out if a field has multiple values how to display those multiple values inline? For example, if a user can enter multiple values for hobbies, i would like to display:

hobbies: running, reading, fishing

instead of

hobbies:
running
reading
fishing

Thank you for your help! Absolutely amazing module!!!!!!

Comments

merlinofchaos’s picture

Project: Views (for Drupal 7) » Content Construction Kit (CCK)
Version: 6.x-2.0-rc5 » 6.x-2.x-dev
Component: Code » Views Integration

All of Views internal multi value fields support this and you're asking about a CCK field I assume, so this should be asking the CCK queue.

akolahi’s picture

Yes, it is a Content Taxonomy Field with Freetagging.

thank you.

akolahi’s picture

Okay so I found this function in CCK:

function theme_content_view_multiple_field($items, $field, $values) {
  $output = '';
  foreach ($items as $item) {
    if (!empty($item) || $item == '0') {
      $output .= '<div class="field-item">'. $item .'</div>';
    }
  }
  return $output;
}

which was causing the line breaks by entering "div" for each field. So I overrode it using:

function phptemplate_content_view_multiple_field($items, $field, $values) {
  $output = '';
  foreach ($items as $item) {
    if (!empty($item) || $item == '0') {
      $output .= '<span class="field-item">'. $item .'</span>';
    }
  }
  return $output;

which is in fact causing my output to look like this....

</span><span class="field-item"><span id="thmr_53" class="thmr_call">
  <a href="/category/media-category/architecture/interior-design">interior design</a></span>

</span><span class="field-item"><span id="thmr_54" class="thmr_call">
  <a href="/category/media-category/cinematic-arts/photography">photography</a></span>

</span><span class="field-item"><span id="thmr_55" class="thmr_call">
  <a href="/taxonomy/term/8">Fashion</a></span>

so, the over-ride is working - but for some reason I'm still getting line breaks :( I'm not really understanding why.

Any ideas?

thanks.

akolahi’s picture

This is embarassing... the culprit was my stylesheet...

#sidebar-left a {
display: block;
}

yched’s picture

I'd love if someone contributed a patch to extend the rendering options for multiple values in Views :-).

iNade’s picture

Actually, i'm looking for the same thing... so if someone found the answer, i'm in ! :)

markus_petrux’s picture

Status: Active » Closed (duplicate)

An example on how to solve this issue: #556232: multiple values in views

hunglyvn’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev