Action @CUT
Copies and remove the content that follows this action to use it elsewhere in the document with @PASTE
.
Should be followed by some content, then a @ENDCUT
action to mark the end of the cut content. This content
will be removed from the document and will only appear where a corresponding @PASTE
is used.
Think of the common cut/paste pattern. DocuMold is essentially doing that when generating a document.
Usage
Parameters
name |
(Required) The name to use to refer to this copied content with |
Examples
More information
The @CUT
and @ENDCUT
actions and the content between them will be removed from the document.
@CUT
is meant to be used with the @PASTE
action, which also receives a “name”. The @PASTE
action will be replaced by the
content of the @CUT
(or @COPY
) that has the same name. @PASTE
can be used before or after the @CUT
(or @COPY
).
Multiple @PASTE
actions can be used with the same name of a @CUT
(or @COPY
).
The main use for this action is if you have a section of content that you use in multiple places in the document,
possibly within multiple @IF
. Place the shared content at the end of the document, wrap it with the @CUT
and @ENDCUT
actions, then every other places that need it, use @PASTE
to use the content.
The content of a @CUT
action is always copied for use elsewhere in the document (with @PASTE
), even when the @CUT
is removed by a @IF action.
The name of the @CUT
must be unique within the document, including with the names @COPY
actions.
Which to use between @COPY
or @CUT
is mostly a preference. If you want the content to be at one of the places where it is needed, use @COPY
,
if you prefer to make it easier to find by placing it at the end of the document, use @CUT
.