SonicWikiPersos
JeuxMegadrive
MegaCD32XSaturnDreamcast/GCGame Boy AdvanceMultiplateformesDessins animés |
SyntaxThe generic form of the (:if:) directive is
(:if cond param:)
where " cond " names a condition to be tested from the $Conditions array, and "param " is a parameter or other argument held in $condparm in the test. For example, the following (in config.php) adds (:if group GroupName:) as a markup:
$Conditions['group'] = "FmtPageName('\$Group',\$pagename)==\$condparm";
One could then use the following markup:
The negated form of (:if:) is automatically handled as well, thus:
(:if ! group PmWiki:) This text appears everywhere *but* in group "PmWiki"(:if:)
Any (:if:) automatically terminates the previous one, thus markup can be easily cased:
(:if group PmWiki:) Do this in PmWiki group
(:if group Main:) Do something else for Main
(:if:) This happens in all groups
All that remains now is to come up with a good set of $Conditions . Testing for group membership is a good one, we might also want to create something for generic pagename pattern matches
(:if match ^PmWiki\. :) Only appears in the PmWiki group
(:if match RecentChanges$ :) Everywhere except RecentChanges pages
(:if ! match ^(Main|PmWiki)\. :) All groups except Main and PmWiki
(:if:) again - all groups
$Conditions could also be conditional on other items; e.g., date or time, day of week, etc.
samples for if-markups /
|