Invalid Domain
You are here :
![]() |
XSSI if, elif, and else directives
Basic
syntax:
How to insert a new if directive Advanced patterns If the expression you need is more complex - such as a combination of two or more separate expressions - the Advanced mode will be necessary. This mode simply provides a text box in which you can edit the actual contents of the expression directly. You can switch to the advanced view by clicking the "Advanced" tab. When you click "OK", the directives you have created will be inserted into your document. You will see something like the following:
Or, if automatic translation of XSSI content is enabled, you will see something like this:
The text between (and including) the curly braces is editable and should be replaced with the content that you want displayed when the directive that surrounds it is true. Once the page is translated, you will see a maximum of one directive from any block at a time (since only one can be true at any given time). Editing if directives in your
document
From the inspector, you can modify the current directive in much the same way as when you first inserted it. There are the same three modes (browser, basic, and advanced), which are automatically selected according to the type of expression in the directive, but which can also be selected manually through the tab interface. The inspector can also be used to navigate the if block: Clicking the prev and next buttons will take you to the next appropriate if directive, and, if the document has been translated, it will make that portion of the if block visible (as if the expression were true) and available for editing. For more information about using if, elif, and else directives (and XSSI in general), take a look at our introduction to XSSI. Can't find something?
|