首页 > 解决方案 > 无法检索附件 url

问题描述

我有一篇带有文件字段的文章

module.exports = {
extend: 'apostrophe-pieces',
name: 'article',
label: 'Article',
pluralLabel: 'Articles',
orderings: true,
addFields: [
 Other fields...
 {
    name: 'files',
    label: 'Files',
    type: 'singleton',
    widgetType: 'apostrophe-files'
  },
 ]
};

在 html 中,我使用了撇号文件小部件

  {{ apos.singleton(data.piece, 'files', 'apostrophe-files') }}

当我在 html 中显示它们时它工作正常,但是当我单击为下载文件而创建的链接时,它在控制台中给了我错误。

模板警告:无法检索附件 url,因为它丢失了,已设置默认图标。请尽快解决这个问题!

我看不出我做错了什么。

标签: apostrophe-cms

解决方案


我现在不知道为什么,但似乎它不起作用,因为我几天前上传了文件,并且附件的 url 因某种原因发生了变化。我将文件放入垃圾箱,并添加了新文件,效果很好。


推荐阅读