Custom Module (with custom child modules)
I'm creating a custom module (Class) and each entity could have multiple custom children modules (Sessions). I've used the Module Builder to create the Class module and I'm thinking of creating the Session object through the Module Builder. Here are some of the questions I'm thinking I'm going to run into:
1. To create the relationship between the two modules, do I just need to do it in the database? Or is there an easy way through the UI? (I have a short text field in the Session module to place the class's baseID in).
2. When a property of the Class item is modified, I'm going to need to create some Sessions. I've created a custom Field and Dialog for this, but how do I get the currently modified Class baseID while I'm editing it? (I'm currently doing all of this in the dialog's JS file)
3. When editing a Session object through the backend UI, is there a simple way to pull a property from the parent object? (just to display)
Let me know if I need to clarify anything that might have gotten a little too wordy :P
Hello,
Our module builder doesn't support hierarchical modules yet, so you cannot "relate" to modules, created by it in any way for the moment. What I can suggest as a workaround is use taxonomies for your case.
On the second question - I don't really get what you need. From what I understand you want to take the current item's ID in Edit mode, but why do you need that?
The last question is related to the first one I suppose - there is no way to create hierarchical structure of items, created by Module builder.
On the second question, here's my logic.
Hi Miles,
I still cannot get the whole picture. So, you currently have a field control in your module and this field control opens a dialogue to create child items of the current Content item. What you want to do is from the field control, get the ID of the current Content item that you are editing (while in edit mode) and pass it to the dialogue, so that you can use it inside this dialogue to create child content items. Is that correct?
Also, is there a chance that you could post a screenshot of the module in the backend (how the create/edit page and the field in question look like), so that I can get a better picture of it? Thanks in advance.
Hello Miles,
I'm afraid that there is no way to get the current DataItem in a field control. The field control simply has no access to the data item, it just sets a value to one of its Data Columns on SetValue and has no further references to the current data item. The way our UI is built right now, I don't think you will be able to create child items of an item through Field Controls like that.
Kind regards,