Show If Conditional Region

The purpose of the Show If Conditional Region server behavior is to allow the display of a specific region based on the evaluation of a condition. Before applying it, select a region containing data in Dreamweaver's editable area. If the region is empty, an error message will pop-up requesting to select some data.

You can access this server behavior from the Application panel, Server Behaviors -> + -> MX Kollection -> Conditional Regions -> Show If Conditional Region.

The user interface has two tabs. Directions about their correct configuration are given below.

 

To set the dialog box options for the first tab, follow the next steps:

  1. Start building your condition by entering its first member in the Expression 1 text box. You can use the lightning bolt icon to select dynamic data to be evaluated.
  2. In the Condition drop-down menu select the operator you want. The available options are:
    · == - equal: the two parameters have to be equal one to another.
    · != - not equal: the two values have to be different one from another.
    · < - less: the first value is less than the second one.
    · <= - less or equal: the first parameter is less or equal to the second.
    · > - greater: the first value is greater than the second.
    · >= - greater or equal: the first value is greater or equal than the second.
  3. In the Expression 2 text-box enter the second member of the condition. You can use the lightning bolt icon to select dynamic data to be evaluated.
  4. The Has ELSE checkbox determines if a second region will be inserted into the page, region that will be displayed if the condition is not met. Checking this option creates a second translator around a bogus "Else text: change this" content. You will have to replace the Else text: replace this with the content that should appear when the specified condition is not met.
  5. The three buttons in the top right corner of the interface offer you the next functionalities:
    · Click OK when you are done configuring the server behavior.
    · Click Cancel to exit without applying the new settings.
    · The Help button opens this help page.
    These buttons are common to both tabs of the Show If Conditional Region server behavior interface.
  6. Click on the Advanced tab to continue with configuring the server behavior.
 

 

To set the dialog box options for the second tab, follow the next steps:

  1. In the Expression text area you can see the condition you build in the Basic tab. If you prefer, here you can write the condition without using the expression builder, by typing in the members and the operator. This way more complex conditions can be constructed. It allows an improved flexibility, as there are no more restrictions on the operands.
    You can switch between the Advanced and Basic tab as long as the expression in the text area is simple enough to be displayed using the basic elements.

  2. In the Name text box enter the name for the conditional region. You can use any name you want, as long as it is unique per page.
  3. The Has ELSE checkbox determines if a second region will be inserted into the page, region that will be displayed if the condition is not met. Checking this option creates a second translator around a bogus content (Else text: Replace this).

  4. Click OK when you are done configuring the server behavior.

 

Dreamweaver will display a translator surrounding the areas to be displayed based on the condition, and will also add a server behavior. If you want to change the condition, simply edit the existing server behavior.

When editing the server behavior, if you check the Has ELSE option, the ELSE region content will be added to the end of the if region content.