Layout EditorCreated 4 years ago by ryanthompson
The layout editor is coming along but wanted to put some ideas down here in HOW it will work.. I am in a battle vs more traditional form builder cycle vs tons of JS..
So the idea of the layout builder is that you can define 1 or more layouts per stream. A layout being basically the
$structure for a form - based on stream and slug. So the
default layout for
Pages for example. This utility will let you customize it from the CP. So you can put your custom fields anywhere - reorder the existing fields / add tabs / rows / columns / etc within sections or add more sections and customize your form layout. The slug is so you can define multiple per stream in case you want to combine them / change them for whatever reason.
So where I am at now is a mixture of traditional request cycles and JS..
For example - add section (reloads), add tab (reloads), add field (modal -> select -> reloads), all dragging and dropping would be like pages - no reload. But then you'd want to save your ordering (obvious reload).
The reason being is so that we can rely on the underlying UI architecture to produce HTML. I started off using much much much more JS and it was not going to work well if I changed HTML / markup at all. Basically I'd have to mirror HTML / structure changes in JS as well..
Thoughts on this? All in all I think the workflow mentioned above will be a little slower but MUCH more stable and MUCH more maintainable and MUCH more versatile for other CP admin themes.