< Previous | Next >

Lesson 2: Adding template elements and conditions

You can add a range of template elements, queries, and conditions to build a template.
  1. From the Palette view, drag the Container element to the editor area.
  2. Select the container element.
  3. In the Properties view, select the General tab.
  4. For the name property, enter Packages Container.
  5. From the Data Source Schema view, drag the Project/Packages/Package query to the container element.
  6. From the Palette view, add the Paragraph element to the container element.
  7. From the Data Source Schema view, drag the Project/Packages/Package/Name query into the paragraph element. The Select Context window displays.
  8. Select Use as Value, and click OK. A new text element is created inside the paragraph and its content is set to the Name attribute.

    Adding Name element

  9. From the Palette view, drag a paragraph element into the editor.
  10. Drag the Project/Packages/Package/Description attribute from the Data Source Schema into the paragraph element.

    Adding Description element

  11. Select the paragraph element.
  12. In the Properties view, select the Formatting tab.
  13. Click the Italic icon.
  14. List all the requirements from this package:
    1. From the Palette view, drag the List element after the Paragraph element.
    2. Double-click the list element. The New List window opens.
    3. Type 1 in the Insert the number of items field to create a list with a single item.
    4. Click OK in the New List window.
    5. Select the list element.
    6. In the Properties view, select the General tab.
    7. For the name property, enter Requirements list.
  15. Drag the Project/Packages/Package/RequirementsInPackage/Requirement query from the Data Source Schema view into the list detail element.
    Adding requirements from the package
  16. Add a hyperlink element to the editor:
    1. Drag the Hyperlink element from the Palette view to the editor.
    2. From the data source schema, drag the Project/Packages/Package/RequirementsinPackage/Requirement/href attribute into the hyperlink element.
    3. Select the hyperlink element.
    4. In the Properties view, select the Specific tab.
    5. For the Display property, click the Setting field value icon.
    6. In the Set Display Value window, expand the Project/Packages/Package/RequirementsinPackage/Requirement attribute, and select the FullTag attribute.
    7. Click OK.
    8. From the Outline view, drag the InternalHyperlink style into the hyperlink element.
  17. Drag two text elements from the Palette view into the list detail element after the hyper link element.
  18. Double-click the first text element to open the Set Content for Current® Element window.
  19. For the first text element, click the Simple value tab, and type a hyphen (-) to set the content as the static text. Click OK.
  20. Double-click the second text element to open the Set Content for Current Element window.
  21. For the second text element, click the Data Expression tab, expand the Project/Packages/Package/RequirementsinPackage/Requirement/Text, and select Text to set the content as the text attribute.
  22. Click OK in the Set Content for Current Element window.
    Adding Text element to list detail
  23. Optional: Add the following elements to further customize the template:
    1. From the Palette view, add Table of Contents element to the top of the template.
    2. Define a style and apply to a paragraph containing the package name:
      1. In Document Studio, click Style > New Style.
      2. In the Style name field, type Style1 for the style name, and then click Next. The Select style properties window opens.
      3. In the Select style properties window, select the property or group of properties to apply to the template element, and click the Selecting a style icon to select it, and then click Next.

        Adding style property

      4. In the Set Property Value window, type a value in the Property Value column for each property, and then click Next.
      5. Review the summary and click Finish.
    3. Set a condition to exclude the description attributes from output if the data does not contain a value:
      1. Right-click the Paragraph element containing the description, and click Data > Edit Condition. The Set Condition for Current Element window is displayed.
      2. Expand Attributes and select the Description attribute.
      3. In the right view, select the Left operand field to Description.
      4. Set the Operator field to Not equal to.
      5. Type a space in the Right operand field, and then click Add.

        Set condition to the paragraph element

  24. Save the template.

Lesson checkpoint

You added elements to a template.
< Previous | Next >

Feedback