[UPDATE OUTDATED CONTENT] Understanding and Using Relations in Strapi
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.
Thanks @Theodore-Kelechukwu-Onyejiaku . I'm on it
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 π
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!