Search code examples
javascriptstrapiheadlessheadless-cms

Strapi CMS third level populating


I have a problem with fetching third level data from Strapi CMS.

My Structure is the following:

Page > Content(Dynamic Zone) > Multiple Entitys e.g. HeroSliderElement.

So Calling this URL from Postman:

{{protocol}}://{{host}}:{{port}}/api/pages?populate[Content][populate]=*

But since inside my HeroSliderElement are images i have the problem, that i dont get these back.

Request Detail There should be the media data linked from the CMS:

enter image description here

Does anyone have an Idea how to fix this? Any help is appreciated!

I am currently using the following versions of packages:

  "dependencies": {
"@strapi/plugin-i18n": "4.0.7",
"@strapi/plugin-users-permissions": "4.0.7",
"@strapi/provider-upload-aws-s3": "^4.1.0",
"@strapi/strapi": "4.0.7",
"pg": "8.6.0",
"strapi-provider-upload-aws-s3": "^3.6.8"

},


Solution

  • Install the official strapi plugin : strapi-plugin-populate-deep , its easy and great plugin for nested content structure, it worked for me.

    Examples: Populate a request with the default max depth.

    /api/articles?populate=deep
    

    Populate a request with the a custom depth

    /api/articles?populate=deep,10
    

    Populate a request with the a custom depth

    /api/articles/1?populate=deep,10