Support/Kitsune/KB/WikiSyntax: Difference between revisions

From MozillaWiki
< Support‎ | Kitsune‎ | KB
Jump to navigation Jump to search
(Created page with "How to use wiki syntax in the SUMO 2.3 Knowledgebase == {for}, the new SHOWFOR == Both {SHOWFOR} and {DIV(class=win,type=span)} have been replaced by the {for} directive. ===...")
 
No edit summary
Line 9: Line 9:
  {for mac,fx35}Hello{/for}
  {for mac,fx35}Hello{/for}


The markup between {for} and {/for} will be hidden if either of these conditions is met:
A more complex condition with an "or", {SHOWFOR(os=mac+win,browser=firefox3.5+firefox4)} (not actually possible in the old system), is spelled...
* The {for} mentions at least one OS, but it isn't the one the user is running (or has manually selected).
 
* The {for} mentions at least one browser version, but it isn't the one the user is running (or has manually selected).
{for mac, win, fx35, fx4}You are running a Mac or Windows and using Firefox 3.5 or 4.{/for}
 
Formally, the markup between {for} and {/for} will be ''hidden'' if either of these conditions is met:
* The {for} lists at least one OS, but it isn't the one the user is running (or has manually selected).
* The {for} lists at least one browser version, but it isn't the one the user is running (or has manually selected).
Otherwise, the contents of the {for}...{/for} is shown.
Otherwise, the contents of the {for}...{/for} is shown.


{SHOWFOR(spans=on)/} is no longer necessary at the top of each article.
Spaces after the commas are optional.
 
No {SHOWFOR(spans=on)/} or equivalent is necessary anymore; the {for} syntax is always enabled.


=== Inline and block-level contexts ===
=== Inline and block-level contexts ===

Revision as of 22:45, 4 October 2010

How to use wiki syntax in the SUMO 2.3 Knowledgebase

{for}, the new SHOWFOR

Both {SHOWFOR} and {DIV(class=win,type=span)} have been replaced by the {for} directive.

Basic syntax and behavior

{SHOWFOR(os=mac,browser=firefox3.5)}Hello{SHOWFOR} is now spelled thus:

{for mac,fx35}Hello{/for}

A more complex condition with an "or", {SHOWFOR(os=mac+win,browser=firefox3.5+firefox4)} (not actually possible in the old system), is spelled...

{for mac, win, fx35, fx4}You are running a Mac or Windows and using Firefox 3.5 or 4.{/for}

Formally, the markup between {for} and {/for} will be hidden if either of these conditions is met:

  • The {for} lists at least one OS, but it isn't the one the user is running (or has manually selected).
  • The {for} lists at least one browser version, but it isn't the one the user is running (or has manually selected).

Otherwise, the contents of the {for}...{/for} is shown.

Spaces after the commas are optional.

No {SHOWFOR(spans=on)/} or equivalent is necessary anymore; the {for} syntax is always enabled.

Inline and block-level contexts

{for} can be used in both inline and block-level contexts (in the HTML sense). The inline form takes effect when working within a line of text:

This is {for fx35, fx4}inline use{/for}.

The block form is used to wrap entire paragraphs, ordered lists, headings, and so on:

{for fx35, fx4}
This is block-level.

* One
* Two
{/for}

The only caveat is that, when using the block form, the {for} and {/for} should each be on a line by itself. Otherwise, it might be considered part of a neighboring paragraph and produce surprising results.

"not" operator

Since the Knowledgebase will see the addition of new OSes and browser versions from time to time, we introduce a future-proof way of saying, for example, "any OS other than these". This is the role of the {for not} syntax.

Press the {for mac}Apple{/for}{for not mac}Control{/for} key.

The addition of the word "not" causes the {for} contents to show when they would otherwise have hidden and vice versa. The above message would thus read "Control" on any system not running Mac OS.