Hi,
I’m trying to pull entries from a contentType but I can’t seem to get it to work. The content is set up this way
- ContentType
- SectionEntry (entry inside the content type)
- ItemEntry1 (entry inside the section)
- ....
- SectionEntry
- ItemEntry
....
I’m trying to get all the item entries from the section entries. My current solution to grab them is by hard coding the ID values of SectionEntry storing them in an array and passing them into the getEntries()
method. But this method crashes the site if any of the SectionEntry is deleted from contentful.
So is there a way to get the IDs of SectionEntry just by requesting the contentType?
I’ve tried passing in the ID of the contentType into getEntry()
and get getContentType()
but none of them return the sections.
Doing this:
client
.getContentTypes()
.then(response => {
console.log(response);
})
.catch(console.error);
gives me this:
As you can see I querying the contentType doesn’t give me the sections inside it. I’ve also tried getEntry()
and passed in the ID of the contentType via the URL and that too doesn’t work.
I’d appreciate any kind of help, thanks!