Is it possible to embed a content type inside of another content type?
For example I have a schema of “page-header” and want to use it on some other schemas like “homepage”, “about-us”, etc.
I’d like to be able to embed the page-header content directly inside the homepage/about-us content rather than referencing free-standing content. Basically, I’d like to be able to re-use the schema in other parent schemas but don’t want the content itself to clutter up the library since in this case the content isn’t meant to be re-usable.
It’s kind of similar to this request ([IMPLEMENTED] Button to create & add content to an array), but the content is embedded rather than a reference. Btw I don’t see the new button that would allow this feature. Is it available on the latest docker image?
I am still not 100% sure how this would look like, because for me it only seems to be a usability feature. Either you link a content or you have the fields in your content.
For me, it also about how to query this content. With components, it is similar to how Squidex arrays work but with dynamic schema per item.
If you trying to emulate components with linked content you may end up with bad performance since you need to load the content item then load all references, references of reference, etc.
If you have a reference you can define which content items are allowed. These references can be resolved with GraphQL. In GraphQL it means one extra call to the database, for all references in your result set together (per level). So I don’t see a performance issue here.
It works if you know the structure of the content graph in advance but may be a pain when this structure can be highly dynamic. What if you have a set from 100+ components, some of them can be nested in each other, and basically any of these components can be referenced from the root entity? What if the nesting level is also dynamic?
And also editor experience may be much better. Let’s say you have a schema for a checkbox. You don’t want to have a list of all checkboxes on your website, you just want to embed a checkbox into a higher-level component, let’s say form. When you no longer need a form on a page you want to delete it along with the checkbox and any other inner components because they don’t really have any meaning outside of the form.
I would really love to see something similar to the Storyblok experience. Don’t get me wrong, I don’t want to push, I understand that you have a lot of other features in your backlog and I have no idea how complex this one could be. But in my opinion, the components feature will bring the overall Suidex experience to the next level.
Sorry, for the late response. What I mean: How should it behave when you have a localize field that embeds a schema with localize fields? It could become very complicated.
I finally work on this feature now. The goal is to implement single item components within the next weeks and then array of components. One challenge I am facing is the graphql mutations. Not sure if I can support multiple component types here.
I’m not sure if it makes it any easier but I think embedding schema in the localized field could be just banned since we can localize fields in the embedded schema itself.
When you create a new schema, you can select whether the schema should be a component. Components are not visible in the UI. I am not sure whether I am going to block API calls as well, as it is a lot of work without that much benefit. It just adds a lot of extra checks everywhere.