概述:
有人查看一篇文章(内容类型:文章)。这篇文章有一个标签列表(contenttype : articletags)。
基于本文中的链接标记,我试图对具有一个或多个相同标记的文章进行查询(将其称为具有相同标记的相关文章)。
这里是结构:
let tags = article.items[0].fields.tagsList.map(tag => {
return tag.fields.navn
})我需要查询这样的文章:
contentful.getEntries({content_type: ‘article’}) ???如何查询ids?
发布于 2019-03-26 22:19:30
发布于 2021-12-30 06:51:59
可以使用in运算符查询带有给定标记的条目。
contentful
.getEntries({
content_type: "article",
'fields.tags': "website" , //tag id = website
})
.then(({ items }) => {
console.log(items);
})
.catch(console.error);https://stackoverflow.com/questions/55092466
复制相似问题