Chris Wray
Chris Wray

Reputation: 7

How do I show a label on a many to many relationship in Directus?

I have added working, many-to-many relationships to a directus api through the directus admin app, but in the directus app when going to add an item to a collection, the label for the select options are not being propagated. I am able to select items and save everything correctly, so I know the many to many relationship is set up correctly, but I cannot propagate the label correctly. I have tried several different methods, including using the . notation to access fields in the relating collection, but to no avail.

When using dot notation, the relationship never loads and only shows a loading sign, while when putting nothing in label works, but no label.

Below are a couple screenshots:

This is where i put in the label

This is one of the many to many relationships

This is the loading sign that never changes when using dot notation or anything in label.

Upvotes: 3

Views: 2071

Answers (3)

juanitourquiza
juanitourquiza

Reputation: 2194

If you want to see the name in directus 9. It's possible in the option Display Template.

enter image description here

Upvotes: 1

Muhammad Ali
Muhammad Ali

Reputation: 339

dicectus api many to many

This worked for me. Please dont confuse it with DropDown Template

Upvotes: 1

RANGER
RANGER

Reputation: 1691

I don't believe you need to include the junction table (dot notation), just the field name in the related table, like this: name... and for the template, you need to use a template string, like this: {{name}}

Hope this helps! We're cleaning up the field creation process now to make this more intuitive.

Upvotes: 2

Related Questions