[Pmwiki-users] how can I display the current skin name?

Neil Herber nospam
Thu Jan 20 07:35:36 CST 2005


Hi Hans

Just to be perfectly clear, the numbered items you have quoted below were 
*alternative solutions* that I was suggesting to solve a simple problem.

I want to be able to display the name of the skin in use and provide a link 
to the PmWiki page that describes it in a "programmatic" fashion, such that 
if I change the skin, the name and link will change automatically. I seemed 
like a neat way to be able to credit skin authors and allow interested 
users to link to the skin page.

That said, my answers are below ...

At 2005-01-20  10:46 AM +0000, Hans Bracker is rumored to have said:
>Tuesday, January 18, 2005, 5:55:17 PM, Neil wrote:
> > 1) In my local pub/ directory, change the skin directory and file names to
> > match the case of the PmWiki documentation pages. (My server is 
> case-agnostic).
>
> > 2) Request that skin authors name skin directories and files to match 
> the docs.
>
>Do you mean that the cookbook page about a skin should have the same
>name, excluding 'Skin', as the custom skin directory? So for example
>having  a page called GeminiTwoSkin in cookbook should be matched by a
>directory called GeminiTwo for the custom skin? Or will geminitwo do,
>but gemini2 will not? I prefer all lower case file names, and you seem
>to too according to point 1.

If the skin was called "GeminiTwo" then:
* the cookbook docs page should be called "GeminiTwoSkin"
* the skin directory name should be "GeminiTwo"

The $Skin variable contains the directory name and I create a link to the 
PmWiki docs page by using {$Skin}Skin.

This link does not work if the cases of the skin name and the docs page 
don't match because the PmWiki.org server is case sensitive. My server is 
case agnostic, so I changed the local directory name to make this work - 
but I have to remember to make the change for any new skin.

> > 3) Include a $SkinDocsName variable (suggested name only) in a skin that
> > uses the case of the docs. Then I could link to that.
>
>Who should define this varable? I suppose the skin author should. But
>he can only do this in a customskin.php file. But he may not use one.
>best place would be really in the template file, in a meta tag perhaps
>which can be read by pmwiki and assigned to the new variable you
>propose.
>
>Alternatively a skin author can add the skin name to a credits block,
>and even hard code a link to the skin docu page. But i am not too fond
>of having permanent links to other sites in the template. Better to
>point to a page locally, see next.

The variable has to be defined by the author somewhere and somehow inside 
the skin directory. I will leave the implementation up to better minds than 
mine.

> > 4) Store the skin docs locally (not ideal, since they get updated and have
> > comments appended.)
>
>Still a good idea since it can be linked with easy and can give all
>basic information, plus provide a link to the cookbook page.

Not my preferred solution, and it still suffers from the case problem 
described above.

> > 5) Create a local page with the skin name and a redirect to the PmWiki docs
> > - except I can't get redirect to work on external links. (How can I do that
> > , by the way???)
>
>i hope redirection to external pages is not allowed/possible in the
>default situation. opens the door t too much mischief.

Hadn't thought about people other than me using this redirect. Hmmm. It 
does open a big hole. Glad this was my fifth choice!

*******
New options:

If skin names were restricted to having only initial caps *in the docs*, 
then this can work without any changes because the markup:

         [[Cookbook/{$Skin}Skin]]

would be expanded to

         [[Cookbook/geminitwoSkin]]

and would link to

         Cookbook/GeminitwoSkin

because PmWiki capitalizes the form letter in the page name.

OR .....

Just create a redirect page on PmWiki.org named  "GeminitwoSkin" that 
redirects to GeminiTwoSkin.

This last idea requires no changes at all. Just the addition of a PmWiki 
page for those skins that have CamelCase names.


>

Neil

Neil Herber
Corporate info at http://www.eton.ca/
Eton Systems, 15 Pinepoint Drive, Nepean, ON, Canada K2H 6B1
Tel: (613) 829-4668 




More information about the pmwiki-users mailing list