Documentation Center

Running a Template

After you have assembled Template Building Blocks in a Template in Template Builder, you need to run a Page Template against a Page, a Component Template against a Component, and a Template Building Block against a package to check the correct functioning or the Template.

Procedure

  1. Start Template Builder by selecting Start from the Windows menu and selecting SDL Group > Tridion Sites Template Builder from All Programs or Programs.
  2. Open the Template you want to run.
  3. Run the Template by doing one of the following:
    • Press F5.
    • Click the Run button in the toolbar.
    • Select Debug > Run from the main menu.
  4. If this is the first time you are running this Template since you started Template Builder, a dialog appears that asks you to select a content item for this Template to run against. The Page or Component to run against may be selected from a different Publication than the one in which the Template resides:
    • For Compound Page Templates, navigate to a Structure Group in a Publication that contains a Page you want to run this Template against, and select that Page.
    • For Compound Component Templates, navigate to a Folder in a Publication that contains a Component you want to run this Template against, and select that Component.
    • For Template Building Blocks, navigate to the folder on your local hard drive or local network drive on which you have saved a package, and select that package.

    Click OK to confirm your selection and start running the Template.

  5. During and after the Template run, Template Builder displays:
    • an item called Input above the first Template Building Block in the sequence next to the Template Building Block it is now executing, a yellow bar next to it with the text Running... over it if a Template Building Block was successfully executed, a green bar next to it if a Template Building Block failed to execute successfully, a red bar next to it the time spent executing each Template Building Block
    • an item called Input above the first Template Building Block in the sequence
    • next to the Template Building Block it is now executing, a yellow bar next to it with the text Running... over it
    • if a Template Building Block was successfully executed, a green bar next to it
    • if a Template Building Block failed to execute successfully, a red bar next to it
    • the time spent executing each Template Building Block
  6. After a successful or unsuccessful run, you can examine the output produced during the last executed debug run by doing one of the following:
    • Select any Template Building Block to see the contents of the package after that Template Building Block was executed in Package view, or select Input to see the original input package. If a Template Building Block failed to execute successfully, you cannot examine the package contents from that point on.
    • Select an item in Package view to see the contents of that item in Item View at that stage in the processing. Specifically, if your run was successful, select the last Template Building Block in the sequence, and then the Output item in the Package view to see whether the Template produced the output you intended it to produce.
    • Step through the Template Building Blocks using the same types of controls available in Visual Studio, that is:
      Step Into
      Open a Template as Template Building Block in a new tab and examine its Template Building Blocks, as explained in Debugging a Template Building Block.
      Step Over
      Select Step Over from the Debug menu or from the context menu, or press F10, to move one step ahead in the Template. If you are currently on the last Template Building Block in an embedded Template as Template Building Block Compound Template, this means that you jump up a level to the next Template Building Block in the parent Template.
      Step Out
      Jump out of a Template as Template Building Block, that is, up a level and to the next Template Building Block in the parent Template, as explained in Debugging a Template Building Block.
      Step Backward
      Select Step Backward from the Debug menu or from the context menu, or press Ctrl+F11, to move one step back (up) in the Template. If you are currently on the first Template Building Block in an embedded Template as Template Building Block, this means that you jump up a level to the same Template Building Block, but now in the parent Template.
  7. If the run was unsuccessful, check the Output view for more information about why the Template Building Block with a red bar next to it failed to execute.
  8. If you want, you can select Debug > Reset Results to clear any data generated during the run and close debug-related panels: Package, Item View, Output, and Watch windows.