How would you go about creating a content type in which the administrator can create nodes and then create links connecting one node to another?
Would you have to create a custom plugin for the dashboard to implement that? Or is that another easier way to achieve that?
I’m not sure I entirely understand the question, can you explain a little more?
Basically, I need an administrator to create a graph (like react-digraph: GitHub - uber/react-digraph: A library for creating directed graph editors)
Does that clarify things? I tried a few approaches and I can’t find one that works.
While I can achieve something like this through just free-text inputs. Ideally, I’d like a way for the admin to be able to select the nodes and not just type it through free text.
I’m sorry I still don’t quite understand, can you clarify what nodes are? (Are you trying to use models to construct the data structure required by this package?)
Yeah, you’re right on the latter point, we need to construct a data structure required by the package.
To elaborate a bit more on the details, this is for an EduTech project where the students will traverse a maze by answering questions.
Hence the administrators will need to be able to construct the maze through the nodes and links (with the nodes being questions and the links being answers.)
The main difficulty is with creating inter-connected data in a single Content Type (ie a link will reference previously nodes as the edges). Do you have an idea of how I could solve this issue?
Does that make more sense?
You could use a self-referencing relation, like the oneWay
(far left on the relational matrix)
Do you have an example of some kind of how to do that in Strapi?
I’ve never heard of oneWay before.
I’m unsure if this is pertinent but I’m using MongoDB as the underlying database.
Ohh okay that makes sense. I’ll try to build out a test Content Type and see if that works. I completely forgot about self-relations. Thank you!
I’ll post an update here if it ends up working out
Keep in mind if you are creating a new model, you need to create the model and add your normal fields, then save, and add the self-referencing relation (for it to show up on the right side to select)