Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I have a multi value select list field in the content type.

In views it is currently displaying as:

title: test title
field_name: value1, value2, value3

And I want it to display it like this:

title: test title
key1: value1
key2: value2
key3: value3

Where field_name is the multi value field. Any Idea?

share|improve this question
    
I have not try but i think create tpl file for the views and print the field. –  Smalution Sep 1 at 13:03

2 Answers 2

In order to display the value of a field differently.

In the view, click on that particular field listed under FIELDS section. In the window that is opened select MULTIPLE FIELD SETTINGS then from there change DISPLAY TYPE to one of existing or Simple Seperator and provide * html break line br * as value of Simple Seperator.

Alternative approach:

Under FORMAT -> SHOW select Content not Fields and choose the View Mode as Full Content then by default, all the values are displayed one per column.

If you want further editing then consider reading about

  1. Delta
  2. Module to allow adding PHP Code so you can iterate through values
  3. Override a template
  4. Preprocess function for that particular field.
share|improve this answer
    
right!! this is what I was trying to suggest –  harshal Sep 1 at 13:39
    
@harshal this is the most easy and straight-forward method –  Raf Sep 1 at 14:34

For Multi value field there is an option in the views field settings like given below

Ordered List
Unordered List
Seperated
... so you can I guess achieve it using inbuilt views functionality

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.