Search the FirstSpirit Knowledge Base
Hi
Need to transfer the particular box from marginal column to content left area automatically.
We should not move the box manually via right click copy and paste.
Is that any way to write a script for that.
Please find the attached screen shot.
Thanks in advance.
Hello,
I think you`ll need a scipt that executes the following steps:
* create a new section in the left content area
* copy the content from the old to the new section
* delete the old section in the marginal content area
Best regards
Michaela
Hello,
you can also just use IDProvider#moveChild(IDProvider child, int nextSiblingIndex) to move the section.
Something like this:
//e.g. context.getElement() if you use a context menu script executed on the section to move
sectionToMove=...;
page = sectionToMove.getParent().getParent();
targetBody = page.getBodyByName("NAME_OF_BODY_TO_MOVE_THE_SECTION_TO");
//move to the LAST position in the target
targetBody.moveChild(sectionToMove, -1);
//OR: move to first position
targetBody.moveChild(sectionToMove, 0);
Remarks:
Michael
Hello,
do you need further help or did Michaela's or Michael's reply already help you? If so, it would be great if you marked the reply as "correct answer" so that other community users find the solution easily. If you have already found a solution by yourself, it would be very kind of you, if you posted it here.
Best regards
Tim