Component Cleanup BEFORE Submit
We have a component that allows our authors to dynamically select the number of columns and the associated widths. Example 12, 7-5, 6-6, 4-4-4, 3-5-4, etc
Once they have selected this click save, they can add components into each of the corresponding parsys.
If the user changes their selection from 4-4-4 (3 columns) to 12 (1 column), nothing "cleans up" the orphaned nodes.
Desired Result Example:
4-4-4 - 3 Columns
columnControl
col0
componenta
col1
componentb
col2
component
12 - 1 column
columnControl
col0
componenta
Unfortunately, this is the actual result .... meaning col1 & col2 are orphans and NOT removed from the parent nodes.
Actual Result Example:
12 - 1 Column
columnControl
col0
componenta
col1
componentb
col2
componentc
Is there something I can do to remove the orphaned content BEFORE the new structure is saved?
Thank you for your assistance.
-Dean