community-content icon indicating copy to clipboard operation
community-content copied to clipboard

[UPDATE OUTDATED CONTENT] Understanding and Using Relations in Strapi

Open Theodore-Kelechukwu-Onyejiaku opened this issue 8 months ago β€’ 6 comments

Hi @miracleonyenma, thank you for your contribution to the "Write for the Community" program.

Content Issue

We would love to have an article update on "Understanding and Using Relations in Strapi". The main issue is that it lacks a detailed explanation, as shared by the documentation team.

"I have seen multiple instances where something gets mentioned near the start of the article, but then the article fails to go into a detailed explanation. For example: https://strapi.io/blog/everything-you-need-to-know-about-content-modeling This article mentions "Hierarchical Content Models" but doesn't explain how to approach them in Strapi. https://strapi.io/blog/understanding-and-using-relations-in-strapi This article mentions polymorphic relationships, but doesn't explain how to create them."

This means we will have to try as much as possible to explain and implement them with detailed explanations. If not, please don't list them.

Assignment

Please kindly update this article to include "polymorphic relationships" and how to create them in Strapi 5.

πŸ‘‰ Here is the markdown draft for you: https://hackmd.io/@theodore1250/rk5mJk1pkl

Please let me know if you are willing to do this. Thank you!

Hello @Theodore-Kelechukwu-Onyejiaku. I want to work on this update.

shammadahmed avatar Mar 24 '25 23:03 shammadahmed

Thanks @Theodore-Kelechukwu-Onyejiaku . I'm on it

miracleonyenma avatar Mar 25 '25 02:03 miracleonyenma

Hi @miracleonyenma ,

Please what is the status of this work?

Hi @Theodore-Kelechukwu-Onyejiaku

Thanks for checking in. Sorry, I haven't been able to finish up yet. I'll be done soon and give you an update by the end of the day.

Thanks πŸ™

miracleonyenma avatar Apr 22 '25 11:04 miracleonyenma

Thank you! @miracleonyenma

Hi @Theodore-Kelechukwu-Onyejiaku πŸ‘‹,

Just finished making the update!

I added a clearer explanation of polymorphic relationships and included an example showing how to create one by directly modifying the Strapi schema file β€” located at: ./src/api/[content-type-name]/content-types/[content-type-name]/schema.json

Since this can’t currently be done via the admin dashboard, the example should help clarify things.

I also updated the example code so that they can check out the updated schema here: πŸ‘‰ Source code on GitHub

Let me know if you have any questions or need further clarification. Thanks!

miracleonyenma avatar Apr 22 '25 16:04 miracleonyenma