Variables in Flare are a powerful tool. They make it easy and efficient for authors to reuse and manage commonly used text such as company and product names. They are also great for dynamically displaying an important date and time on a page, such as the last time a topic was updated.

Adding the date a topic was last updated can be helpful for you as the author because it allows you to keep track if a topic needs to be updated with new, helpful information. It’s also meaningful for the end-user to see the last time a topic is modified because it gives the documentation more credibility and trust when they can see that the information is up-to-date. 

Adding the last updated date to a topic can be a tedious step to remember to do manually. In this blog, we will explain how to add a date and time variable that displays on every topic and automatically updates every time the topic is saved.

Basic steps illustration

Create a Custom Date/time Variable

The first step is to create a custom date/time variable.

  1. In Flare, open the Project Organizer.
  2. Click the Variables folder.
    Your variable sets are displayed.
  3. Double-click the variable set to open the Variable Set Editor.
    In this example, the variable set is named “General”.
Project Organiser screenshot
  1. Select the Add DateTime Variable button.
    This will create a new variable in the variable set.
Select Add DateTime Variable button screenshot
  1. Name the variable.
    We have named ours “LastSavedDate”.
  2. Click in the Definition cell for the variable.
    The Edit Format dialog opens.
  3. In the Enter Format Specifiers field, enter a combination of format specifiers for the desired date and time format.
    For a [Month] [Day], [Year] format, copy and paste: MMMM dd, yyyy. Specifiers are based on Microsoft's custom date and time format strings.
    For more specifier combination examples that you can use in this field, see the Flare online Help.
  4. Select On File Save in the Update field.
    This configures the variable to display the last time the topic was modified.
Edit Format dialogue screenshot

Inserting the Variable into a Template Page

After the variable is created, the next step is to insert it into a template page.

Instead of adding the variable to each individual topic, we can instead insert the variable into a Template Page. This will allow you to display the date and time on each page of your output and will update in the output as if they are a part of the topic.

  1. From the Content Explorer, open the Template Page.
  2. Place your cursor in the template page where you want to insert a custom date/time variable.
    If you insert it above the Topic Body proxy, the date, and time are shown in the header (above the topic content).
    If you insert it below the Topic Body proxy, the date, and time are shown in the footer (below the topic content).
  3. From the Ribbon, select Insert > Variable.
  4. The Variables dialog opens, with the variable set(s) on the left and the variables associated with the selected set on the right.
  5. On the left side of the dialog, select the custom variable set that you created.
Variables dialog box screenshot
  1. Click OK and Save. The custom date/time variable is added to the template page.

Optional: Add text to go along with the date variable, like the example below.

Example topic with last modified on... screenshot

Note: Since the variable is inserted in the template page, this means that the date variable will only appear in the output. You will not see the variable in the topic within the XML editor in Flare.

Tip: For more information on template pages and how you can put them to work, visit this blog post.

Build your HTML5 target, and you’ll see that each topic will have a unique last modified or last updated date! Every time the topic is edited and saved in Flare, this date will automatically be updated in the output after it is built.