I have a grid field like this:
File - Text field - Relationship field
Where the file is a document, the text field is the title and the relationship field is the argument.
I would like to output the list of files like this:
Argument 1
- File 1
- File 2
- File 3
Argument 2
- File 4
- File 5
- File 6
And so on, therefore grouped by the relationship field.
Now I have something like
{grid}
<li><a href="{grid:file}"> {grid:text_field} </a> - {grid:relationship}{grid:relationship:title}{/grid:relationship}</li>
{/grid}
That shows me:
- File 1 - Argument 1
- File 2 - Argument 1
- File 3 - Argument 1
- File 4 - Argument 2
- File 5 - Argument 2
- File 6 - Argument 2
How can I output the items by grouping them by argument? It means that the relationship field must shows only one time per type, and create a list for every type.