Skip to main content

Insert a Dynamic Text Variable

When you know what elements and attributes you want to use for your dynamic text variables, you add them to your topics. This works for both HTML5 and PDF output.

To write XPath expressions, there are several things you need to be aware of:

  • Include the "d:" prefix for navigatingthe XML, for example: ${/*[1]/d:info/d:title}$. The namespace prefix d is bound to http://docbook.org/ns/docbook

  • Some DocBook attributes and Paligo extension attributes do not require a prefix. To access the extension attributes, use the @xinfo prefix, for example ${@xinfo:time-modified}$. It will show the date as a computer code, see Dynamic Text Variables for Time and Date for examples of how to make it readable. The namespace prefix xinfo is bound to http://ns.expertinfo.se/cms/xmlns/1.0.

  • For PDF output the top-level node that you can access is article. You cannot access the article's parent node (part).

To insert a dynamic text variable:

  1. Select the topic or component in the Content Manager to open it in the Editor.

    Content Manager in Paligo. It shows the Documents section contains an Acme 100 Topics folder. Inside the folder there is a publication and many topics, including "Connect to Network (100).

    Alternatively, you can Create a Topic and edit that.

  2. Position the cursor at a valid position for the dynamic text variable.

    For example, inside a para element.

  3. Press Alt + Enter ⏎ (Windows) or Command ⌘ + Enter ⏎ (Mac) to display the Element Context Menu.

    Element context menu shows a search field and a list of elements that are valid at the current position.
  4. Enter phrase and select it from the menu.

  5. Select the phrase element in the Element Structure Menu and choose Go to element.

    Phrase_Go_To_Element.jpg
  6. Add the role attribute in the Element Attributes Panel and set its value to dyntextvar.

    phrase-role-dyntextvar.jpg

    This will add the minimum required syntax for the dynamic variable

    <phrase role="dyntextvar">${}$</phrase>
  7. In the phrase element, enter the syntax for the relevant XPath expression to access the element or attribute you want to use.

    Important

    If you use an expression to access an element or attribute that does not exist, the dynamic text variable will be empty (blank) in the output.

  8. Select Save. Save icon.

  9. Preview the topic to verify the timestamp.