[pmwiki-users] Using an if statement to detect skin .tmpl?

Ian MacGregor ardchoille42 at me.com
Sat Oct 26 04:00:21 CDT 2013

This works perfectly! Thank you very much. It also gives me some new ideas of things that could be done with custom page variables.

The power of PmWiki never ceases to amaze me.

Rev. Ian MacGregor

> On Oct 26, 2013, at 12:51 AM, Petko Yotov <5ko at 5ko.fr> wrote:
> Ian MacGregor writes:
>> What I'd like to do is include a conditional statement in my website header that allows visitors to toggle between a desktop skin and a mobile skin. I have installed the Set Skin recipe that allows users to switch to a different skin simply by adding ?setskin=skinname to the end of a page url. What I need to be able to do is detect which skin is currently being used.
>> How would I do this?
>> (:if $Skin desktopskin:)
>> [[{*$FullName}?setskin=mobileskin | Mobile View]]
>> (:else:)
>> [[{*$FullName}?setskin=desktopskin | Desktop View]]
>> (:ifend:)
>> Which variable is used for the skin and how do I use this variable in a conditional statement?
> You can define a customPageVariable {$CurrentSkin}, see
> http://www.ianmacgregor.net/PmWiki/PageVariables#custompv
> and in a wiki page, use (:if equal "{$CurrentSkin}" "mobileskin":), see
> http://www.ianmacgregor.net/PmWiki/ConditionalMarkup#built-in-conditions
> Petko
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users

More information about the pmwiki-users mailing list