TEXTBLOCK

The statement TEXTBLOCK is used to insert regular or Rich Text Blocks in the result document.

Note

ITP Models using this feature can be created with ITP/Workstation, but to run a model containing this feature, you will need ITP/Server or ITP/OnLine Server.

Note

The keyword EDITABLE_TEXTBLOCK replaces the statement QUESTION TEXT_BLOCK that is used in a FORM question, to indicate that the end user can enter text content with layout. For more information on the keyword EDITABLE_TEXTBLOCK, refer to the documentation of the FORM.

You can use the statement TEXTBLOCK with the options NAME and VAR. The option NAME precedes the name of the Text Block, given literally and with quotes. Use the option VAR when the name of the Text Block is not known beforehand, but retrieved in the model. Here you give the name in a variable. Besides this a few extended options can be used.

If one or more Field Sets are configured on the ITP/MDK Repository folder where the Text Block is located, the model developer is responsible for defining a special variable FIELDSET for each of these Field Sets. Also if the Text Block in question does not use any of the fields in the Field Set.

Definition

TEXTBLOCK
NAME "folder\name of the (rich) text block"
TEXTBLOCK NAME "first,second,third" or "first, second, third"
VAR variable
PARAGRAPH_SYMBOL "paragraph symbol"
STYLE_PREFIX "name of the prefix"
ASSIGN_TO variable
QFORM qform
SUPPRESS_FINAL_PARAGRAPH
DATA_DEFINITION NONE
PATH variable

Description of the options

TEXTBLOCK

This keyword indicates that a Text Block is inserted. It needs at least a NAME or a VAR.

NAME "folder\name of the (rich) text block"
NAME "\folder\name of the (rich) text block"
NAME "MyProject.name of the (rich) text block"
NAME "Myproject.\folder\name of the (rich) text block"

If a Text Block specification does not start with a backslash, the ITP/MDK Repository will look for the object in a number of folders that were specified during project configuration. Text Blocks have their own search paths that can be configured on the Runtime tab of the project configuration dialog.

When inserting an object, you can specify an absolute location. Appending a backslash in front of the name or path of the object signifies this. Text Blocks that are specified in this way will be searched only and in that exact location. Note that this backslash comes after a possible project specification.

If the Text Block is referred in the model with a name that includes the project, the object will be sought in that project. A reference can include the project by adding the project name and a dot in front of the actual name. For more information on search paths refer to the Help, chapter Search paths.

Refer to Retrieving dynamic building blocks for an overview on how Text Blocks and other dynamic building blocks are retrieved from the ITP/MDK Repository.

VAR variable

Use VAR if the name or folder and name of the Text Block is stored in a variable or a field from a Field Set. If the variable or the field contains more than one Text Block, selected with a Text Block MULTISELECT question, the statement TEXTBLOCK will handle all Text Blocks in the Field Set. Since the Text Blocks are saved to the field or variable as a CSV the model developer can also split the different Text Blocks in separate values using the split_csv function.

PARAGRAPH_SYMBOL "paragraph symbol"

Optional. Is mainly used when a Text Block needs to be inserted in a table cell. PARAGRAPH_SYMBOL contains the paragraph symbol that holds the style that is applied to the Text Block. To insert this Text Block in a paragraph cell the paragraph symbol needs to be declared within a table cell itself as well. A corrupted result document could be produced if an incorrect paragraph symbol is used.

STYLE_PREFIX "name of the prefix"

Optional. STYLE_PREFIX contains the prefix of the set Text Block styles that needs to be applied to this particular Text Block. If this parameter is left empty ITP will search by default for the Text Block styles with an ITP prefix. Refer to Lay out of Text Blocks for more information on the lay out of Text Blocks.

ASSIGN_TO variable

Optional. You can use this option if the Text Block should be stored in a variable and not printed at the location where the statement TEXTBLOCK is called.

QFORM qform

Optional. You can use a QForm to ask questions to the end user for fields, which do not have a value yet. The end user will only be asked for fields, which are also used in inserted Text Blocks. The developer can only use a QForm when he inserts a Text Block.

SUPPRESS_FINAL_PARAGRAPH

Optional. If this keyword is used, the paragraph marker at the end of the final paragraph of the Text Block will be omitted. This can be used to treat Text Blocks as text fragments.

Note

If the Text Block ends with a list element the final paragraph marker cannot be omitted.

DATA_DEFINITION NONE

Optional. If the ITP Model is compiled with a Data Definition the variable _data is used to locate applicable Field Sets. The reserved value NONE explicitly disables the use of the Data Definition.

See below for a description of the DATA_DEFINITION and PATH keywords.

PATH variable
PATH NONE

Optional. If this keyword is used the variable is used to determine the current location in the Data Definition to locate applicable Field Sets. The reserved value NONE disables any PATH values that might be derived.
See below for a description of the keywords DATA_DEFINITION and PATH.

Inserting multiple Text Blocks

To insert multiple Text Blocks at once, a list of Text Blocks can be specified. The names of the individual Text Blocks should be separated by comma signs.

TEXTBLOCK
NAME "First Text Block, Second Text Block, Third Text Block" or "First Text Block,Second Text Block,Third Text Block"

Note

If multiple paragraphs are inserted by a single TEXTBLOCK statement, the keyword SUPPRESS_FINAL_PARAGRAPH will only affect the last Text Block in the list.

Text Blocks and Data Definitions

If the statement TEXTBLOCK is used within a FOREACH WIZARD loop the context of the FOREACH WIZARD statements is used to automatically determine the location of the Text Block in the Content Wizard. If the Content Wizard uses a Data Definition to support repeating groups and the FOREACH WIZARD loop is within a Data Definition Group, the current iteration of the Data Definition Group elements is determined to pick Field Sets within that loop. This guarantees that Text Blocks within a repeating group will refer to the correct iteration.

If the statement TEXTBLOCK is used outside any FOREACH WIZARD loops, or any Field Sets cannot be located in the Data Definition, the Field Sets are additionally searched for within the current scope in the ITP Model.

The keywords DATA_DEFINITION and PATH can be used to change the default behavior. The keyword DATA_DEFINITION can be used to disable the use of the _data variable and limit the use of Field Sets to local variables.

The keyword PATH indicates a location in the Data Definition where the Text Block should try to locate Field Sets. Only values copied from the field Path in the statement FOREACH WIZARD can be used with the keyword PATH. Use PATH NONE to ignore any repeating or nested structures in the Data Definition.

Examples

TEXTBLOCK
NAME "..."

In the example above the Text Block using the currently active FOREACH WIZARD context (if any) is inserted.

TEXTBLOCK
NAME "..."
DATA_DEFINITION NONE
PATH NONE

The example above completely ignores any applicable FOREACH WIZARD context and only uses Field Sets which are currently in scope.

TEXTBLOCK
NAME text_block
PATH my_path

The example above uses the variable my_path to determine the active Data Definition context. This can be used outside any FOREACH WIZARD loops to control the context in which the Text Block is produced. The variable _data is used to retrieve the content.