Reference »

How to enable client-side skin selection on PmWiki

Put this into config.php:

 $Skin = $_GET['skin'] ?: (isset($_GET['skin']) ? 'vector' : ($_COOKIE['skin'] ?: 'vector'));

(Or substitute whatever you want your default skin to be, in place of “vector”.)

Then, create a selector form (such as the one on OborWiki):

(:cookie path="/" skin {$^skin} :)

>>rfloat frame border="1px solid #a2a9b1" background-color=#f8f9fa padding="7px 12px" max-width=280px margin-bottom=20px margin-left=20px<<
!!!! Set active skin for this wiki:

* %list skin-list% (:if equal {$^skin} "pmwiki":)'''PmWiki'''(:else:)[[{*$FullName}?skin=pmwiki | PmWiki]](:ifend:)
* (:if equal {$^skin} "zero":)'''Zero'''(:else:)[[{*$FullName}?skin=zero | Zero]](:ifend:)
* (:if [ equal {$^skin} "" or equal {$^skin} "vector" ]:)'''Vector'''(:else:)[[{*$FullName}?skin=vector | Vector]](:ifend:)
* (:if equal {$^skin} "pmwiki-responsive":)'''PmWiki-responsive'''(:else:)[[{*$FullName}?skin=pmwiki-responsive | PmWiki-responsive]](:ifend:)
* (:if equal {$^skin} "academian":)'''Academian'''(:else:)[[{*$FullName}?skin=academian | Academian]](:ifend:)
* (:if equal {$^skin} "alalike":)'''Alalike'''(:else:)[[{*$FullName}?skin=alalike | Alalike]](:ifend:)
* (:if equal {$^skin} "blix":)'''Blix'''(:else:)[[{*$FullName}?skin=blix | Blix]](:ifend:)
* (:if equal {$^skin} "bonny":)'''Bonny'''(:else:)[[{*$FullName}?skin=bonny | Bonny]](:ifend:)
* (:if equal {$^skin} "colorimetry":)'''Colorimetry'''(:else:)[[{*$FullName}?skin=colorimetry | Colorimetry]](:ifend:)
* (:if equal {$^skin} "enlighten":)'''Enlighten'''(:else:)[[{*$FullName}?skin=enlighten | Enlighten]](:ifend:)
* (:if equal {$^skin} "evolver":)'''Evolver'''(:else:)[[{*$FullName}?skin=evolver | Evolver]](:ifend:)
* (:if equal {$^skin} "fixflow":)'''FixFlow'''(:else:)[[{*$FullName}?skin=fixflow | FixFlow]](:ifend:)
* (:if equal {$^skin} "gemini":)'''Gemini'''(:else:)[[{*$FullName}?skin=gemini | Gemini]](:ifend:)
* (:if equal {$^skin} "marinee":)'''Marinee'''(:else:)[[{*$FullName}?skin=marinee | Marinee]](:ifend:)
* (:if equal {$^skin} "minimous":)'''Minimous'''(:else:)[[{*$FullName}?skin=minimous | Minimous]](:ifend:)
* (:if equal {$^skin} "glossyhue":)'''GlossyHue'''(:else:)[[{*$FullName}?skin=glossyhue | GlossyHue]](:ifend:)
* (:if equal {$^skin} "skittlish":)'''Skittlish'''(:else:)[[{*$FullName}?skin=skittlish | Skittlish]](:ifend:)
* (:if equal {$^skin} "papyrus":)'''Papyrus'''(:else:)[[{*$FullName}?skin=papyrus | Papyrus]](:ifend:)
* (:if equal {$^skin} "parchment":)'''Parchment'''(:else:)[[{*$FullName}?skin=parchment | Parchment]](:ifend:)
* (:if equal {$^skin} "phpnet":)'''PhpNet'''(:else:)[[{*$FullName}?skin=phpnet | PhpNet]](:ifend:)
* (:if equal {$^skin} "monobook":)'''Monobook'''(:else:)[[{*$FullName}?skin=monobook | Monobook]](:ifend:)
* (:if equal {$^skin} "simple":)'''Simple'''(:else:)[[{*$FullName}?skin=simple | Simple]](:ifend:)
* (:if equal {$^skin} "triad":)'''Triad'''(:else:)[[{*$FullName}?skin=triad | Triad]](:ifend:)

%right% ([[{*$FullName}?skin=# | '''clear cookie''']])
>><<

(Note that the (:cookie:) directive requires the HttpVariables recipe. Also, the code above doesn’t include CSS; inspect the source of the skin selector for an example of appropriate styles.)