Barelydead / strapi-plugin-populate-deep

A Strapi plugin that makes it easier to populate deep content structures
172 stars 39 forks source link

Not working with other official plugins #22

Closed LuizCesarLeite closed 1 year ago

LuizCesarLeite commented 1 year ago

The request "/api/botike-home?populate=deep" brings all the info in the default locale, but it fails to show other localizations and looks like that it is the case for SEO plugin too:

image

webmasterBotike commented 1 year ago

I noted a mistake: the Deep plugin is actually working with the offical SEO plugin - but no with the official localization plugin.

xHinkle commented 1 year ago

+1 for getting deep results in localizations

pmig commented 1 year ago

the first level of attributes is actually fetched. But it would be nice to get the canonicalUrl of all other languages to add alternate href links. We currently built around it by using a dedicated slug.

I would expect that other locales don't get populated deep without an additional parameter. Maybe allow combining parameters e.g. ?populate=deep:localizations as recommanded here:

The localizations (object) can be included if specifically requested by appending ?populate=localizations to the URL (see relations population documentation. It includes a data array with a list of objects, each of them including the id and attributes of the localization.

https://docs.strapi.io/developer-docs/latest/plugins/i18n.html#getting-localized-entries-with-the-locale-parameter

Barelydead commented 1 year ago

Thanks for reporting, Ill have a look and see if I can sort something out

Barelydead commented 1 year ago

I'm not sure I follow actually. The plugin works with i18n, what am i missing?

Get content in default locale /api/articles/1?populate=deep

Get content in another locale (swedish) /api/articles/1?populate=deep&locale=sv

LuizCesarLeite commented 1 year ago

I'm sorry @Barelydead, I get fooled by the locale's atributes reference at the end of JSON response. Using the parameter as you wrote done the trick :-)

Thanks a lot!