Documentation Center

Creating conditional regions

While working on your Template Building Block in Adobe Dreamweaver you may find it helpful to display contents on your screen that you do not want SDL Tridion to process. You can use optional regions and set them to false to display content you do not want SDL Tridion to process.

About this task

For example, if SDL Tridion Sites automatically generates navigation controls, the input package would contain some variable called, for example, @@GlobalNavigation@@. In Adobe Dreamweaver, you insert this variable in the position where you want the navigation controls to appear. You may find it helpful to nevertheless display a mock-up of the navigation in Adobe Dreamweaver to give you a feel of what the page will look like. Such a mock-up is only a visual aid and should therefore not be included in the actual Template Building Block.

Procedure

  1. Start Adobe Dreamweaver and open an Adobe Dreamweaver Template.
  2. From the main menu, choose Insert > Template Object > Optional Region.

    The New Optional Region dialog opens.

  3. Click OK to confirm your changes and close the dialog.
  4. Hard code the condition to the value false (or to any other expression that evaluates to false):
    <!-- TemplateBeginIf cond="false" -->
    ...
    <!-- TemplateEndIf --> 

Results

When the template is processed, the contents between the start and end tag are evaluated. SDL Tridion Sites will completely ignore expressions in the Dreamweaver Template that evaluate to false.