Tagging a Design Object with a Text File Content Object
The text file content object is a pointer to a text file that is referred to in your data source.
To insert a text file content object:
-
In InDesign, click the Type Tool icon and then use the mouse to draw a rectangular area in the document, or place the text insertion point in an existing text frame in the document.
-
In the Dynamic Content panel, double-click the desired text file content object.
The object is inserted into the document.
Use nested composition
Text file content objects are used to create dynamic text by referencing recipient-specific text files stored in the assets folder. Many times these are static text files; however, it is possible to make these assets dynamic, by tagging the text within the file with content objects. By creating a text file content object that references two or more text files, text within your document can change dynamically depending on the conditions you have built into the text file content object’s rule. This enables the values of content objects within each asset to be calculated per-recipient at proofing or composition time. Accordingly, this feature is known as Nested composition. Nested composition is where an asset file referenced by a text file content object contains references to other content objects.
Nested composition applies to the following text formats supported by text file content objects:
-
Plain Text (*.txt)
-
Adobe Tagged Text (*.txt)
-
Rich Text Files (*.rtf)
-
XNIP (*.xnip) (see XNIP (*.xnip) file format).
Tag an asset file with content object reference
Tagging an asset with a content object is done by typing a content object 's name inside double curly brackets. The following is an example of a tagged plain text Asset:
Happy birthday {{First Name}}!
The same content object reference method can be used in Adobe Tagged Text files (see Using Nested Composition with Adobe Tagged Text) and Rich Text files. When XNIP files are exported, content object tags within the exported text are embedded as part of the XNIP file.
Set up nested composition with a plain text asset
The example below shows the use of nested composition with two plain text files tagged with content objects. You can try the following workflow with the uCreate Print tutorial sample document.
To set up nested composition with a plain text asset:
-
Open your text editor and create two or more text files.
-
In each file, type the text to be placed dynamically in the document, including a reference to one or more content objects, for example:
Text File 1: {{First Name}}, as a Stellar club member, you are entitled to 50% discount.
Text File 2: Had you been a club member, {{First Name}}, you would have received a discount.
-
Save each text file in the assets folder of your campaign, for example:
Text File 1 saved as discount.txt
Text File 2 saved as nodiscount.txt
-
Create a new content object and set its type to text file content object.
-
Use the If/Then rule, and set the condition as Club level, function = String: Stellar; Then Text File = String discount; Else Text File = String nodiscount, or use the names of the text files you saved in the assets folder if you used different names.
-
Make sure you do not type the file extension “.txt”.
-
In the document window, draw a text frame and tag it with the text file content object.
-
Select the text, right-click it and select Dynamic Content > Enable Nested Composition.
-
Scroll through the records to view the text change dynamically within the document, as shown in the following figures.
Note: Make sure to store your assets in the assets folder of your campaign.
Use nested composition with Adobe tagged text
Nested composition with Adobe Tagged Text differs from a plain text file tagged with content objects, in that it provides the ability for styling parts of the text in the asset, for example setting its color, font family or point size.
To use nested composition with Adobe Tagged Text you must first create Adobe Tagged text files.
Note: Tagged text in this context does not relate to tagging with content object, but rather to Adobe proprietary tags that save style information in a text file.
This following design needs to display different messages based on club membership, as well as containing the recipient’s first name. We can do this by using Adobe Tagged Text or XMPie XLIM’s XNIP.
To create a tagged Text File:
-
In your document, draw a text frame and enter the text, including the text content object you wish to style, for example, {{First Name}}, as a Stellar club member, you are entitled to 50% discount.
-
Style the text as required, as shown in the following figure.
Note: Make sure that if you style references to content objects, the whole reference, including the curly brackets, uses the same style.
-
Select all the text and from the File menu, select Export to export the text as an Adobe InDesign Tagged Text file (*.txt) into the campaign's assets folder.
-
Name the text file, and click Save.
The Adobe InDesign Tagged Text Export Options dialog is displayed.
-
Select Tag Form: Verbose, and Encoding: Unicode.
-
Repeat steps 1 to 5 for each tagged Text File, using the filenames “discounstyled” and “nodiscountstyled” if you are using the same sample detailed in Setting Up Nested Composition with a Plain Text Asset, or using the names of the Text files you saved in the Assets folder if you used different names.
-
Create a new content object as a text file content object, using the If/Then Rule, condition as Club level, function = String: Stellar; Then Text File = String discountstyled; Else Text File = String nodiscountstyled, or use the names of the Text files you saved in the Assets folder if you used different names.
Make sure you do not type the file extension “.txt”.
-
Select the text, right-click it and select Dynamic Content > Enable Nested Composition.
-
Scroll through the records to view the text and styling change dynamically within the document, as shown in the following figures.