2

I'm creating a view that return grouped rows. Depend on the rows count under each group, I want to show different fields.

For example,

Group 1

  • row 1
  • row 2
  • row 3

Group 2

  • row 1
  • row 2
  • row 3
  • row 4

Group 3

  • row 1
  • row 2
  • row 3
  • row 4
  • row 5

Let's say if I have limited space then for Group 1, I want to show full text for all 3 rows. For Group 2, I want to show full text for the rows 1 & row 2 then trimmed text for the row 3 & 4. For Group 3, I only want full text for row 1 then trimmed text for the rest.

In Views advanced setting Theme:Information Style template print rows and Row style template print fields. In Row style template, if I know which row am I printing and how many rows in that group then I know which fields to display. For example, If I'm printing row 2 in the group of 5 then I know I need to display trimmed text field.

So my question is how can I know that in Row style template?

Thank you!

Your Answer

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

Browse other questions tagged or ask your own question.