我有两种类型的作品,一种是Authors,另一种是Articles。我可以显示文章列表(通过使用indexAjax.html
和index.html
in articles-pages
),因为它在 Apostrophe 的Demo中实现,也可以显示作者列表(通过使用indexAjax.html
和index.html
in authors-pages/views
)。
我的问题是如何使用show.html
file of显示某些指定作者撰写的文章authors-pages/views
?
因此,当用户点击某个作者时,他/她应该能够看到指定作者撰写的文章列表。
文件lib/modules/articles/index.js
如下
module.exports = {
extend: 'apostrophe-pieces',
name: 'articles',
label: 'Article',
pluralLabel: 'Articles',
contextual: true,
addFields: [
{
name: '_author',
type: 'joinByOne',
withType: 'author',
label: 'Author',
idField: 'author',
filters: {
projection: {
title: 1,
slug: 1,
type: 1,
tags: 1
}
}
},
....
]
};
任何帮助将不胜感激!