Support/Kitsune/KB/WikiSyntax

From MozillaWiki
< Support‎ | Kitsune‎ | KB
Revision as of 22:14, 4 October 2010 by Erikrose (talk | contribs) (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. ===...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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}

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

  • 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).

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

{SHOWFOR(spans=on)/} is no longer necessary at the top of each article.

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.