"Xanadu" and the Flaming-X logo are registered trademarks of Project Xanadu. |
|
5 Visitor(s) on Site 98 Wiki Pages Recently Modified
Sections (edit)How This Wiki Works
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Recent Changes Printable View Page History Edit Page | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Content Last Modified on May 26, 2007, at 04:44 PM CST
authors, admins (advanced) Using the (:if:) DirectiveThe (:if cond param:) body (:ifend:)
(:if cond param:) body (:else:) body (:ifend:)
(:if cond param:) body (:elseif cond param:) body (:ifend:)
where "cond" names a condition to be tested (described below), and "param" is a parameter or other argument to the condition. Conditions do not nest. The built-in conditions include:
Negated forms of conditions also work:
Any (:if enabled AuthPw:)* You're logged in (:if auth read:)* You can read (:if auth read Group.Page:)* You can read Group.Page (:if auth edit:)* You can edit (:if auth upload:)* You can upload (:ifend:) Using wildcard placeholdersThe character
Use with page list templatesConditional markup is used extensively with page list templates. Use with page variables: = current item < previous item > next item Conditionals used to structure pagelist output:
Combining conditionsConditions (as previously defined) may be combined into more complex conditional expressions using one of these three equivalent forms: (:if expr EXPRESSION :) (:if [ EXPRESSION ] :) (:if ( EXPRESSION ) :) Conditions are combined into expressions with boolean operators and brackets. In the next table, A and B are either regular conditions or (round-)bracketed sub-expressions of regular conditions:
Nota:
Thus, the following is a valid way of building an expression that shows the following contents only when the user is either the administrator, or is logged in and the time is later than the given date: (:if [ auth admin || ( authid && date 2006-06-01 ) ] :)
Nesting with square brackets will silently fail to work as expected: (:if [ auth admin || [ authid && date 2006-06-01 ] ] :) NOTE: Doesn't Work!
A common use of these complex tests are for expressions like: (:if expr auth admin || auth attr || auth edit :)
[[Logout -> {$Name}?action=logout]]
(:ifend:)
which provides a logout link only when the browser has admin, attr, or edit permissions. admins (advanced) Creating new conditionsSee Cookbook:ConditionalMarkupSamples. << InterMap | Documentation Index | Page variables >> |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Recent Changes Printable View Page History Edit Page | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest (c) 2001-2007 Jeff Rush | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||