Rearrange child components within parent component
I have a parent component with cq:isContainer=true property and card components within the parent component.How to make the cards reorderable,i.e, move card 3 above card 1 etc?
I have a parent component with cq:isContainer=true property and card components within the parent component.How to make the cards reorderable,i.e, move card 3 above card 1 etc?
Hi @pleben
One way is to drag them in crx. But I guess is not desirable as it will be a pain to maintain this all the time.
Or, if you have a multifield, you can move up and down the items in the dialog.
Or, if you don't want to not rely on the order AEM stores them, you can have a "position" property for each card, authorable (you can also have a js to validate value uniqueness if you like ), and have a backendlogic (in Sling model eventually) that returns to your frontend components the list of cards in the configured ordered.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.