Mostafa Bahri
Mostafa Bahri

Reputation: 2644

Directus many-to-many display template not showing up

I'm not sure where Display Template option is supposed to show up on M2M relationships.

Here on movies collection setting up genres:

Relation

and the options

enter image description here

Docs seems confusing about the distinction between Visible Columns and Display Template:

Visible Columns sets the columns the interface shows (we're using name)

Display Template sets the columns the interface shows (we're using {{movie.name}})

Visible Columns does the above; in this example shows the title column in edit page for genres:

enter image description here

Alright, great!

But what about the template? maybe in the collection list?

no, just the count:

enter image description here

I've tried all these templates but nothing shows up anywhere:

What is the correct template here? Where is Display Template supposed to show up?

My collections setup:

movies
 title text,
 genres M2M (alias)

genres
 title text

movies_genres
 id pk,
 genre numeric,
 movie numeric

Thanks

Upvotes: 3

Views: 1856

Answers (1)

Philleep Florence
Philleep Florence

Reputation: 66

This applies to O2M Interfaces:

Since there can be more than one related item linked, in the items list, the display template is rendered as a number of items until you interact with the item...

If you place your mouse over the Genres Fields, you should see the display template rendered.

A popover should show up and display the list of items as you defined.

Upvotes: 2

Related Questions