|
|||||||||
|
|||||||||
![]() |
![]() |
Conditional MacrosBefore you try to use conditional macros, you need to understand the basic syntax of Conversant's macros (how they're written). See the top of the Simple Macro docs page. Conditional macros allow you more extensive control over the output of your pages based on current rendering conditions. They're tests, or "conditions". If the test is passed (referred to as "returning true"), then the text and macros enclosed by that condition is used. If the test fails, then the next test is checked, and so on until a test is passed or the end of the conditionals are reached. The names of the conditional macros are: if, elseIf, else, and endIf. They're used like this:
Understanding this example should be pretty simple. The name of the macros used here were "if", "else", and "endif". In the "if" macro, the Now here's the same set of macros, in action:
If you're a member of this site, and you've logged in, then you can see lines 1, 2, and 4. If you're not yet a member, or you haven't logged on, then you see line 3 instead of line 2. Understand? Log on or off of the site, then come back here and you'll see the other line, which might help you understand what's happening. Note: if you aren't a member, you can sign up for free. See the rest of the docs for more information on conditional macros. If you have any questions, please ask them here on the support site (requires free membership). View in DG |
![]() |
||||||
This site managed with Conversant, © Copyright 2009 Macrobyte Resources |