How to show the names of related existing items? #35
-
So from what I understand: We have a Pages Editor Nodes collection, that can relate any item to a specific M2A Editor field. On the M2A field, we can specify which items to support.
Now my question is: how can I ensure that in the editor, the names of those existing pages are displayed? I tried setting the Display Template of the "Related pages" object to Pages > Pages ID > Title, but that doesn't work. It shows -. Any clue? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Thanks, this is a really good question. Even though it is a Directus related question, I will try my best to answer it here. If you were just relating to a single page, it would be easy because you would use an M2O field instead and just use the title of the M2O item. It gets more complex with a M2M or M2A field. The fact, that If you want to display the titles directly, you need to create a custom display extension or an action-hook or a flow (on create + update) that computes the titles into a new (hidden) field (inside the |
Beta Was this translation helpful? Give feedback.
Thanks, this is a really good question. Even though it is a Directus related question, I will try my best to answer it here.
If you were just relating to a single page, it would be easy because you would use an M2O field instead and just use the title of the M2O item.
It gets more complex with a M2M or M2A field.
The fact, that
Pages > Pages ID > Title
shows a--
seems to be a bug in Directus. But either way it would not be the solution because it would show aX items
button, which would open a popover with the titles.If you want to display the titles directly, you need to create a custom display extension or an action-hook or a flow (on create + update) that computes the titles into a n…