1

I have a content type: products. This content type use its own taxonomy (type1, Type2, Type3).

My content has 2 fields: Title and baseline (and more, but I don't want to use them on this view).

What I want:

Display a page with my products listed by taxonomy

Type1
   [title Product 1] [baseline product 1]
   [title Product 2] [baseline product 2]
   [title Product 3] [baseline product 3]
Type2
   [title Product 4] [baseline product 4]
   [title Product 5] [baseline product 5]
Type3
   [title Product 6] [baseline product 6]

I can do this easily, But I want more: I want to use views accordion module to display that. And I want the types being the header tabs.

The problem is: whatever I try, I get the same problem:

the module makes each node a tab

Type1
<title Product 1 tab >
   [title Product 1] [baseline product 1]
<title Product 2 tab >
<title Product 3 tab >
Type2
<title Product 4 tab >
<title Product 5 tab >
Type3
<title Product 6 tab >

In screenshot: (Don't pay attention of the text, it's some creepy test content):

tabs on each nodes

My objective:

layout of objectif

3 Answers 3

2

From your question, I'm assuming that you've already created view and set everything.

You just need to do some Format settings for Views Accordion in your View.

Here are the steps to make your grouping field as the "header" or "trigger" of the accordion action.

  1. Go to Format: Views Accordion Settings and select Grouping field.
  2. Check "Use the group header as the Accordion header"

I've tested it myself. It works as you expected.

1
  1. use field display
  2. check "Exclude from display" for all fields
  3. add "global custom text"
  4. now using the replacement pattern you can set markup for all those field in text area.

note: global custom text should be placed below the fields you are using as replacement pattern otherwise you will not be able to find replacement pattern for that field

0
1

Suppose you use the taxonomy for filtering this. Then follow the instructions given below:

  1. The field of taxonomy be the first.

  2. Later field be the title and later description.

  3. Go to settings of views accordion.

  4. Grouping field number 1 the first field of view, or taxonomy field, and use rendered output to group rows.

  5. In the last option of settings called, disable if only one result select this option, and you see that working.

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