Drupal views combine 2 columns into 1?

I have two types of content, both have a node title and a document attachment, the doc attachment fields are different names (from two different types of content).

In my opinion, I show the node header and file name in the table. Node headers are great in one column, but two nested attachment fields appear in two separate columns, making three columns common when there should be only two. Each row has one document name, but one or the other column is always empty, depending on what type of document title the content type is displayed.

How can I combine these two fields to display in a single column so that it looks no problem? It is not important to know that these documents are taken from two different types of content. They are organized in larger taxonomic terms, so it is not possible to simply make two different opinions.

+7
views drupal union drupal-fields
source share
3 answers

Alas, the answer was right at the prompts:

Column

By default, each field is its own column. However, you can place multiple fields in one column. to do this, select which field you want the column to represent, then select another field and set the column to β€œvalue for this field. You can place as many fields as you like in one column, but only the main field in the column can be sorted by click

+12
source share

I found this answer and it works for me:

http://drupal.org/node/1120304#comment-5111606

+1
source share

You can use any field as a token in another field in the Views module by default.

So, if you want to combine text fields together, say that you have field A with the value "Hello" and field B with the value "World", and you want the field concat with the value "Hello World":

1) Change field A, select an exception from the display, do the same with field B 2) Create field C as Global: Text and make sure it is ordered after field A and field B (you can use fields only as tokens if they are defined before the target field). 3) Now you can see the replacement patterns that are available to you only under the text area of ​​values ​​in field C. It will be something like [field A] [field B]

Now, if you want to calculate a numeric field based on two other fields, the method is similar to concat, except for the C field, you should use the Global field: Math Expression: 1) Change the A field, select an exception from the display, do the same with the field B 2) Create field C as Global: Math Expression and make sure that it is ordered after field A and field B (you can use fields only as tokens if they are defined before the target field). 3) Now you can see the replacement patterns that are available to you only under the textarea value in field C. It will be something like [field A] + [field B]

0
source share

All Articles