Directus 多对多显示模板未显示

标签 directus

我不确定哪里显示模板选项应该显示在 M2M 关系上。

movies 集合中设置 genres:

Relation

和选项

enter image description here

Docs似乎对可见列和显示模板之间的区别感到困惑:

Visible Columns sets the columns the interface shows (we're using name)

Display Template sets the columns the interface shows (we're using {{movie.name}})

Visible Columns 执行上述操作;在此示例中显示 genres 的编辑页面中的 title 列:

enter image description here

好的,太棒了!

但是模板呢?也许在收藏列表中?

不,只是计数:

enter image description here

我已经尝试了所有这些模板,但任何地方都没有显示:

  • {{title}}
  • {{movie.title}}
  • {{genre.title}}
  • {{genres.genre.title}}

此处正确的模板是什么?显示模板应该显示在哪里?

我的收藏设置:

movies
 title text,
 genres M2M (alias)

genres
 title text

movies_genres
 id pk,
 genre numeric,
 movie numeric

谢谢

最佳答案

这适用于 O2M 接口(interface):

由于可以链接多个相关项目,在项目列表中,显示模板呈现为多个项目,直到您与项目交互...

如果您将鼠标放在流派字段上,您应该会看到呈现的显示模板。

popover 应该出现并显示您定义的项目列表。

关于Directus 多对多显示模板未显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61274683/

相关文章:

php - 当直接使用数据库更新内容时,如何在 Laravel 中使用正确的数据更新搜索索引?

postgresql - 如何使用 Directus 流在创建时将值从一列复制到另一列

laravel - Directus.io 与 Laravel 航海者

directus - 如何使用标准的 directus 接口(interface)创建自定义接口(interface)?

python - 使用 Python 机器学习的 Directus 自定义过滤器/搜索

javascript - 如何从 Directus 获取图像?

php - 为什么相同的 http 请求在浏览器中有效,但从我的 Android 应用程序发送时却失败了?

content-management-system - 在 Directus CMS 中重命名表