-
Have been toying with the landing page example for a few days, I added multi page support and basic data binding to the text control,
In Edit mode you should only see one child, so you only need to design one child, but out of edit mode the child controls should be repeating. I copied Container control and i guess i should modify the render function, instead of:
do something like:
Can't figure this out with my current knowledge of all the frameworks involved, so I'm asking for guidance. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Well, seems I have been able to pull this on my own :) I modified container initialization, get editor state and inspect the children
now in the render function
Still not finished, but seems i can get there from here, now i guess i will have to fiddle with React.createElement or something to pass the array element as prop to the child component |
Beta Was this translation helpful? Give feedback.
-
@cederron @heyjaypray
but your original question was: "In Edit mode you should only see one child, so you only need to design one child". So, I assume what you want is having Repeater as a canvas and letting user drop things (e.g. Child) into it, which will be repated but when you drag&drop a Repeater component and then a Child component into it, this don't we need some cloning using CraftJS nodes similar to what's discussed here? |
Beta Was this translation helpful? Give feedback.
Well, seems I have been able to pull this on my own :)
it was simpler than expected.
I modified container initialization, get editor state and inspect the children
now in the render function
Still not finished, but seems i can get there from here, now i guess i will have to fiddle with React.createElement or something to pass the array element as prop to the child component