Adding dynamic content to a master page

You can render data inside master pages in Rational® Publishing Engine. When designing a master ensure that the data attributes are available. Although data attributes cannot be used inside a master page element, you can use variables to hold your data.

Before you begin

Create an internal variable and assign a data value to the newly created variable. Internal variables are used for calculations and are not displayed in the document specification. See Defining and assigning variables for more information.

About this task

You cannot add queries to a master page.

Procedure

  1. In the template editor, insert a Container element.
  2. Right-click the Container element and select Data > Edit Assignments.
  3. Click Add.
  4. Select a variable and click OK.
  5. In the Set Assignments for Current Element window, click the Data Expression tab.
  6. Select an attribute to assign to the variable and click OK.
  7. Add the Paragraph element after the Container element.
  8. Select the Master Page from the Outline view and drag it into the Paragraph element.
  9. Save the changes.

Example

Adding the name of a DOORS module to the header:
  1. Add a DOORS data source schema.
  2. Create a new container in template and assign the module query in the container element. When you assign to template elements, you can use all the attributes of the elements returned by the queries.
  3. In the container element right-click and select Data > Edit Assignments. Select the variable and go to Data Expression in the Set Assignments for Current Element and assign to the variable the module.Name attribute.
    Set assignments for current element window.
  4. As a result the _documentTitle variable holds the module name. In the master page, add a text element and set the variable as value in the location where you want to display the name of the module. You must assign the master page to an element in document template. This element should be placed after the container with variable assignment.
    Template with a variable in the container element.

Feedback