Using SHOWFOR

Actions
Show content customized for:

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 2 or 3, 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

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:

Windowswin
Mac OSmac
Linuxunix
Windows and Mac OSnoUnix
Windows and LinuxnoMac
Mac OS and LinuxnoWin

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}

Click OKClose the preferences window

{DIV(class=noMac,type=span)}Click {DIV(class=button,type=>span)}OK{DIV}{DIV}{DIV(class=mac,type=span)}Close the preferences window{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:

Windowswindows
Mac OSmac
Linuxlinux
Windows and Mac OSmac+windows
Windows and Linuxlinux+windows
Mac OS and Linuxlinux+mac

For different versions of Firefox, use {SHOWFOR(browser=firefox3)}.

Firefox 2firefox2
Firefox 3firefox3

In cases in which you need not os and browser, separate them with a comma.

For example:

{SHOWFOR(browser=firefox3,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 one of these bugs.


Did this article solve a problem you had with Firefox?

Was this article easy to understand?



Page last modified on Wednesday 20 of August, 2008 11:57:33 PST.
Contributors to this page: Chris_Ilias .

Tags in This Article