Using Texts
References in Smartforms and PDFs
Place a reference wherever the text should appear, for example in a text element of a Smartform or in a PDF template:
[[ LIB : HRDOCS : sick-leave ]]LIBmeans “from the Text Library”.HRDOCSis the folder. Use the folder code when the folder has one, so the reference keeps working if the folder is renamed.sick-leaveis the text code.
The easiest way to get it right is to copy the Reference syntax shown in the text editor. In the Smartform designer you can also type [[ in a text field to get suggestions from the Text Library.
When the form or document is shown, the reference is replaced by the text in the form’s language. If the text has no content in that language, the default language is used.
If the folder in a reference does not exist, Studio treats it as an error. If the folder exists but the text code does not, nothing is shown in its place.
Short references
When all texts in a Smartform come from the same folder, you can leave the folder out:
[[ LIB : sick-leave ]]Studio then looks for the text in the Smartform’s Text Library folder. Set it in the Smartform designer, in the page properties, under Text Library folder:
- Static: a fixed folder. Enter the folder code.
- Dynamic: the folder comes from the form’s data, for example
[[ customer.region ]]. Use this when the same form shows different texts for different customers or regions.
If the Smartform has no Text Library folder, Studio uses your company’s default folder (marked with a star in the folder list).
📝 Note: In Development, a short reference that is not found in the folder is also looked up in your other folders. In Test, Pre Production and Production it is not. Set the Text Library folder on every Smartform that uses short references before you publish.
Texts in the Doc Composer
Users of the Doc Composer can search the Text Library and insert texts while they edit a document.
- Tick Public (Available in Doc Composer text search) on each text that users should be able to find.
- Put those texts in a shared folder that has no access restrictions. Texts in private or restricted folders, and texts that are not in a folder, are not offered, even when they are public.
- In Templates, open the toolbar the Doc Composer uses and turn on Text Library under the toolbar features.
- To limit the search to one folder, set the Smartform’s Text Library folder (see Short references). The search then offers only texts in that folder and its subfolders. Without a Text Library folder, all shared folders without access restrictions are searched.
The search looks in the names, codes and descriptions of the texts, not in their content. It offers texts of the same type as the field the user is in: formatted texts for a Rich Text field, plain texts for an ordinary text field.
See Set Up the Doc Composer and Using the Doc Composer.
Which version is used
Forms and documents in Development always use the latest texts. In Test, Pre Production and Production they use the version of the folder that has been published to that environment. See Environments.