Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Field display template not working on M2M #12768

Closed
lluishi93 opened this issue Apr 14, 2022 · 5 comments
Closed

Field display template not working on M2M #12768

lluishi93 opened this issue Apr 14, 2022 · 5 comments

Comments

@lluishi93
Copy link

Describe the Bug

The display template option does not work, the field container does not show the indicated fields in the configuration. It seems to be showing the ID everytime, no matter what configuration is set.

Configuration:
image

image

MySQL row for directus_fields:
image

Result:
image

To Reproduce

  1. Create collection A with a string field named "name"
  2. Create collection B with a m2m field pointing to collection A. Set the display options to "related values" and set the name in the template
  3. Create some items for collection A
  4. Create an item for collection B and relate it to some of the previously created collection A items
  5. Check that the m2m field does not show the item list with their names

Errors Shown

No response

What version of Directus are you using?

9.8.0

What version of Node.js are you using?

16.13.2

What database are you using?

MySQL 5.7

What browser are you using?

Chrome

How are you deploying Directus?

Docker

@azrikahar
Copy link
Contributor

Hi! Would you mind testing this on v9.9.0 as well? I also believe there is some confusion here. The display template under Display tab is for configuring how it is displayed when viewed in a table layout for example, here's a clip:

chrome_hiCpzJURar.mp4

Whereas what you are looking for should be the display template under Interface instead, as seen here:

chrome_imih0GprwD.mp4

I believe this is working as intended, but will reopen when you can confirm it is still in fact an issue and there were some misinterpretation in my examples/description given above 👍

@lluishi93
Copy link
Author

lluishi93 commented Apr 18, 2022

I tried with 9.9.0 and it doesn't work yet.

The display template field option was used in Directus 8 to render specific fields in the display template under Interface, as you can see here:

configuration:

image

result:

image

The display template in Directus 9 should be the same, and it totally makes sense: when you have a LOT of content, you cannot rely solely on the ID to know which items are related to another.

@rijkvanzanten
Copy link
Member

@lluishi93 I believe the confusion here is between what the Interface and Display is. The Interface is what you're showing in your screenshot, but you're configuring the Display. Try configuring the Display Template option under Interface 🙂

The display template in Directus 9 should be the same

It is 👍🏻

@lluishi93
Copy link
Author

Ok, that seems to be it. Last thing I miss is that in Directus 8. the display was divided in columns, showing the name of the field on top. But this doesn't seem to be the case for Directus 9. Is there something am I doing wrong?

No hyphen:

image

With hyphen:

image

@rijkvanzanten
Copy link
Member

That's correct. V8 used to render in inline tables, v9 uses the row style ux 👍🏻 There's actually an in-works PR to allow rendering as either tables or rows, see #12820

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants