Fun With Placeholders

Inserting Placeholders into text (Bubble Text or the Description or Short Description properties, or a Text Box on a Book Page) is a great feature in SAP Enable Now, but you’re not just limited to the options on the Insert drop-down menu within the Text Editor. You can insert a placeholder for many of an object’s other properties manually, if you like.

From within the Text Editor, (1) click on the Add button, then (2) select Insert Placeholder. From the Select Placeholder dialog box, (3) select the required predefined Placeholder, or (4) manually type the required Placeholder code yourself (see the table below). Or if you’re not entirely sure of the format, insert a predefined Placeholder and then just edit the property reference.

Property Placeholder
(Unique object ID) $#{project:.uid}
Language code (xx-XX) $#{project:.language}
Description $%{project:.description}
Short Description $%{project:.shortdesc}
Content Categories $#{project:.content_categories}
Keywords $#{project:.keywords}
Context $#{project:.context_id}
Roles $#{project:.roles}
Context Information $#{project:.context_info}
Learning App Context > Duration $#{project:.duration}

The table above shows Placeholder codes for Project (simulation) properties, but you can insert Placeholders for other object types by replacing project in the codes above with the relevant object type as follows:

  • Book Page: slide
  • Book: book
  • Text Unit: cdoc

You can also insert a reference to a custom property in exactly the same way – just use the identifier of the custom property (note that this is not the same as the label).

Note that Placeholder codes are case-sensitive. All predefined ones are lower case, but custom ones can be mixed case.

In case you’re wondering why some of the placeholders use $# and some use $%: The Description and Short Description are multi-line fields, and use $% by default to insert the text. You can use $# for these fields as well, but this will insert HTML tags (as text) so this is better suited to embedded code. If you use $% for a single-line field, this will result in a line break being inserted before it.

Finally, if you really want to push the envelope, all of the above examples refer to inserting Placeholders that reference the current object’s properties (or its parent object – for example, a Book that the Book Page is contained in). You can actually insert a Placeholder that inserts a property from an entirely separate object by inserting the UID of the required object, prefixed with an exclamation point, in-between the object type and the colon. For example:

$#{project!PR_DF31F0097D8EABAA:.caption}

would insert the Name of the project with the UID PR_DF31F0097D8EABAA into the text. This is very useful if you want to reference one document from another, because a reference based on a Placeholder will automatically be updated if the referenced object’s property changes (for example, if the referenced project is renamed).