多个内容的 getEntries content_types

Contentful getEntries by multiple content_types

我们可以通过提供多个 content_types:

来获取所有条目吗

我有以下代码,它只能通过一个 content_type 获取所有条目:

cf_space.getEntries({content_type: "contentTypeId"}).then(function(contentTypes){

});

但是我们可以通过提供逗号分隔的 entryId 来获取多个条目吗:

var entryIds = "id1,id2";
cf_space.getEntries({'sys.id[in]': entryIds}).then(function(entries) {              
});

我需要获取每个 content_type 的所有条目。

感谢任何帮助。

谢谢

不,这不可能。您必须执行两个单独的请求。

这可以通过使用以下方法实现。

sys.contentType.sys.id[in]=[content_type1],[content_type2],...

详情见https://www.contentfulcommunity.com/t/how-to-query-on-multiple-content-types/473