Directus 8 many-to-many not displaying

Viewed 371

I have a standard many-to-many table design with 'hosting' and 'months' connected by 'hosting-months'. In Directus 8 interface I set this up as:

enter image description here

I've tried multiple display settings, with the table name and without in dot (Twig?) format. {{months.id}} - {{months.month}} and {{id}} - {{month}} However, whatever I try, when editing record in the collections view, it says No items selected (what I would expect if table is empty), but Add New and Select Existing are both empty.

enter image description here

and

enter image description here

In the end I just want to be able to assign multiple months here, such as January, April, July etc, and it seems like this is what it's designed to do. However I can't get any values to assign. And yes, my 'hosting' and 'months' table both have data.

DB structure is:

tbl hosting
-id
-domain
-cycle_start (not to store data, but seems like this is needed as field for many-to-many field in directus)

tbl months
-id
-month

tbl hosting_months
-id
-month_id
-hosting_id

1 Answers

The display template is executed on the junction table, so you have to go a level "deeper". Try {{month_id.id}} - {{month_id.month}} instead.

Related