Using SHOWFOR
On the Firefox Support knowledge base, if there is content in an article that only applies to Windows, Mac, Linux (or two of those three), or only applies to Firefox 3.0 or 3.6, you can make it only display for people on those operating systems or Firefox versions.
We do this by using a tikiwiki plugin called SHOWFOR. Just like tagging text as bold, you can tag text by operating system or Firefox version.
Table Of Contents
- Basic use
- Phrases and words (only for different operating systems)
- Blocks of content with lists and different version numbers
- Dynamic Content
- Bugs
Basic use
To use the SHOWFOR plugin, when you are editing a page, you must first make sure {SHOWFOR(spans=on)/} is at the top of the article markup. This enables the operating system and version selector at the top of the article.
Phrases and words (only for different operating systems)
For any content you want to assign to a specific set of operating systems, enclose it in {DIV}, with type=span, and class set to the operating system(s).
For example:
{DIV(class=mac,type=span)}Cmd{DIV}
The class names are:
| Windows | win |
| Mac OS | mac |
| Linux | unix |
| Windows and Mac OS | noUnix |
| Windows and Linux | noMac |
| Mac OS and Linux | noWin |
Some common instances:
EnterReturn
{DIV(class=noMac,type=span)}{TAG(tag=kbd)}Enter{TAG}{DIV}{DIV(class=mac,type=span)}{TAG(tag=kbd)}Return{TAG}{DIV}
Right-clickHold down the Ctrl key while you click
{DIV(class=noMac,type=span)}Right-click{DIV}{DIV(class=mac,type=span)}Hold down the {TAG(tag=kbd)}Ctrl{TAG} key while you click{DIV}
OptionsPreferences
{DIV(class=win,type=span)}Options{DIV}{DIV(class=noWin,type=span)}Preferences{DIV}
optionspreferences
{DIV(class=win,type=span)}options{DIV}{DIV(class=noWin,type=span)}preferences{DIV}
CtrlCmd
{DIV(class=noMac,type=span)}{TAG(tag=kbd)}Ctrl{TAG}{DIV}{DIV(class=mac,type=span)}{TAG(tag=kbd)}Cmd{TAG}{DIV}
Blocks of content with lists and different version numbers
Unfortunately, lists and headings will not parse using spans. For those cases, we use the {SHOWFOR} tag.
For example:
{SHOWFOR(os=mac)}Cmd{SHOWFOR}
The OS names are:
| Windows | windows |
| Mac OS | mac |
| Linux | linux |
| Windows and Mac OS | mac+windows |
| Windows and Linux | linux+windows |
| Mac OS and Linux | linux+mac |
For different versions of Firefox, use {SHOWFOR(browser=firefox3.6)}.
| Firefox 3.0 | firefox3.0 |
| Firefox 3.5 or 3.6 | firefox3.6 or firefox3.6 |
In cases in which you need to specify both os and browser, separate them with a comma.
For example:
{SHOWFOR(browser=firefox3.6,os=mac)}Cmd{SHOWFOR}
Dynamic Content
Many pages make use of the dynamic content feature in Firefox Support. We have created content blocks which use SHOWFOR. You can see them at Dynamic Content.
Note: We now use label, not id.
- Good: {content label=open the options window}
- Bad: {content id=open the options window}
Currently, we need {SHOWFOR(spans=on)/} at the top of each page; so we can't switch the content IDs until we know that all pages that use Content IDs have {SHOWFOR(spans=on)/}.
Bugs
If you're having problems with SHOWFOR working properly, it may be this bug.
