Open joeworkman opened 5 years ago
It would be great if you could specify the exact syntax that you would like to use. Even if I don't use the syntax you propose, it will ensure that I'm at least building the right feature.
Otherwise your description is loose enough that I'm not 100% certain that I know exactly what you're talking about. I think I probably do -- but it would be a real bummer if I spent a weeks building something -- and it was the wrong something. 😝
Strange, I really thought this was a duplicate of another bug, but I can't find the other one. 🧐
My thought on this was always that we should have an additional switch for example initTypes
Existing behavior would be unchanged and addInit
alone would add the specified number of the the first stack specified in addTypes
just as it does now so it is non breaking.
We could then specify intiTypes
that would define a template of stacks that would be added in a repeating pattern addInit
times.
By way of an example, suppose we had a table stack with child stacks for headings ( com.somestack.tblhead
) and rows (com.somestack.tblrow
).
Perhaps we would like to add by default a heading followed by 2 rows so give the user a start on building their table.
We would therefore do the following:
-addInit=1 -initTypes="com.somestack.tblhead, com.somestack.tblrow, com.somestack.tblrow"
i.e. we have specified the required repeat pattern for our addInit to operate upon.
Note that addInit is the number of times the repeat pattern is added and not the number of items in the repeat pattern. This retains complete consistency with the way things work at the moment.
This methodology several advantages:
awesome. thank you.
Thanks @atavernor I totally forgot to add in examples
@joeworkman slacker.
It would be nice if the
addInit
option inside%slice%
accepted bundle IDs. This way when there is more than one option, we could add one or more stacks to the parent by default.For example: My Total CMS form stack has the ability to add multiple different types of fields. However, I would like to add the ID field by default.
Being able pass multiple bundle IDs would be a nice thing to have as well.