codihaus / directus-extension-hierarchy-layout

2 stars 0 forks source link

Template option not working with Translation Field #1

Closed u12206050 closed 1 month ago

u12206050 commented 1 month ago

Hey, great addition to Directus!

The layout template option doesn't seem to work with Translation fields. It seems like it isn't fetching the data from the translation relation. As you can see on the image below, it is supposed to fetch translations.* or the specified fields as defined on the the schema for that field eg. translations.title, translations.lang which the translations display needs.

Screenshot 2024-07-25 at 12 21 44
codihaus commented 1 month ago

The title is displayed using Directus's display feature, so if your interface is set up correctly, it should display fully. Could you provide screenshots of the two setup fields you are currently selecting? @u12206050

image
u12206050 commented 1 month ago

I select the actual translation field not a field on the translation item (such as you did with title) The display setting of the translation field is set to Translations (preview translations)

Can attach images once I'm back at work.

u12206050 commented 1 month ago

Layout setup:

Screenshot 2024-07-26 at 22 19 13

The interface display setup:

Screenshot 2024-07-26 at 22 19 36
u12206050 commented 1 month ago

There is a utility function in Directus that gets all the fields for a given template string called adjustFieldsForDisplays

u12206050 commented 1 month ago

I do see it works as expected when I select translations.title then it does actually display as a string. Thanks, just a bit weird that it doesn't work the same as the other layouts in that regard like cards.