2

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?

1
  • I have not try but i think create tpl file for the views and print the field.
    – DRUPWAY
    Sep 1 '14 at 13:03
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.
2
  • right!! this is what I was trying to suggest
    – harshal
    Sep 1 '14 at 13:39
  • @harshal this is the most easy and straight-forward method
    – Raf
    Sep 1 '14 at 14:34
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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