SkinConfig

Summary: Define interactively (via a wiki page) the main parameters of a skin
Version: 0.7 - 13 October 2007
Prerequisites:
Status:
Maintainer: PRZ
License: GPL2
Categories: Skins, Layout, GUI
Discussion: SkinConfig-Talk?
Users: (View? / Edit)

Goal

Define interactively (via a wiki page) main parameters of a skin (background colors and image, font sizes, some layout modifications).

How to

Install the SkinConfig add-on below:

Install:

Extract the files from pmwiki root directory , all files go in their own directory, and that's all. No modification of the config file is required.

Beware that the css directory is writable by pmwiki.

Go to the Site.SkinConfig? page, which is only accessible to administrators. Explanations are in the page itself, read it carefully!

Usage

Open the page 'Site.SkinConfig', define your parameters and click 'Ok'. Wrong parameters will be reset to default values.
Some parameters may not be taken into account immediately due to caching in the server or in your browser. Hitting your browser [Reload] button might be needed to have the results displayed.

If you haven't defined an applicability area, this config apply to the Site.SkinConfig page itself only. This is good for tests. When you are happy with the results, define an area of applicability and click 'Ok'.

An easy way to reset a parameter to its default value is to set its field to blank.

Selecting one predefined style will overwrite your data for fields defined in that style. A predefined style may modify only some fields (e.g. colors) or all of them. You can also save the current values as a predefined style.

If you have activated uploads, you can upload page background images.
Image type is limited to jpeg, gif and png.

Site example :

Configuration

On PmWiki2 only. The script was only tested with the default skin. It may or may not work with others. The parameters are set in the pub/css/local.css file, so they have priority over other css parameters.

To set background images PmWiki uploads need to be enabled. The password is the upload password, and the images are stored in the standard upload location.

Notes:

  • local.css affects all wiki pages. A css file that only affects MyGroup should be named MyGroup.css and MyGroup.MyPage.css will only affect the display of MyGroup.MyPage.
  • file.skc contains the data needed to rebuild the css file.
  • file.skt contains all or only part of what is in a .skc file but can be loaded as a template.

Translations

The strings to be translated are (not yet...) defined in the PmWiki.XLPageCookbookTemplate page, which is used to create any local XLPageCookbook page.
Done :

  • .
  • .

Limitations

As already stated, there is a problem of reloading, because parameters may not be taken into account immediately. This works much better in Firefox than in IE(...).

Modifications not configurable.

Some modifications to the standard pmwiki skin have been made (or will be soon), which are not accessible interactively.

  • Margins set to 8 in the #wikileft and #wikibody containers, and body margins are set to 0. As existing, with some color schemes, the look was a bit weird. The original body margins were 20 pixels.
  • top and bottom body margins sets to 4
  • h3 top and bottom margin set to 20 pixels. % setting don't work properly, so set in pixels.
  • h4 top and bottom margin set to 16 pixels.

Future improvements

  1. There can be a very large quantity of parameters for a skin. Only the mains have been defined here in order to stay simple. If you really estimate that some others parameters needs consideration, please inform in the 'discussion' paragraph.
  2. A 'textarea' zone may be created to add your own parameters, but that will seriously weak the control of parameters. And also that will broke the run on <enter> ability.

Tech points

As this module only apply to the Main.SkinConfig page, i simply set the file inclusion in the file local/Main.SkinConfig.php. This file was already there to deactivate the browser caching so it simplifies the installation and do not load at all the others wiki page. Nothing to write anywhere, juste transfer files...

License

GPL

History

  • 23 Jan. 2005 V0.1 - 1rst issue -
  • 25 Jan. 2005 V0.2 - Code and Misc. improvment -
  • 29 Jan. 2005 V0.3 - Vast improvement :
  • 27 Apr. 2005 V0.5 - Correction of background image directory setup
  • 2 may 2007 V0.6 - Big update to adapt to recent versions of pmwiki
  • 13 Oct 2007 V0.7 - Remove cascading authorization, which crash pmwiki

Contributor

PRZ


Discussion

Link: http://www.rouzeau.net/w3/pmwiki.php?pagename=Site.SkinConfig is producing an Internal Server Error. — tamouse September 15, 2012, at 01:36 PM


If someone can inform about any fault in the visual results or CSS alarms (especially IE5). Known bug is the disparition of the vertical separator on versions of IE6, seemingly related to padding-left modification. ...


Hi Pierre,

I am using your interactive skin customization script for PmWiki, nice script, thanks. I am able to change background color for the top, left and text parts. However there is a kind of difficulty in applying the background images.

Here is my set up.

I have this WikiGroup, Magazine, with file upload enabled, and I have renamed Main.SkinConfig and Main.SkinConfig.php to Magazine.SkinConfig and Magazine.SkinConfig.php respectively.

Image upload was fine, and I was able to view the uploaded bgimage.jpg on the Magazine.SkinConfig page. However, when I apply the background image to a WikiGroup called MyMagazine, the background image fails to show up. The reason turns out to be that background-image:url in the MyMagazine.css (so is in the Magazine.SkinCofing.css) is generated incorrectly. It is ...Magazinebgimage.jpg, which misses a ‘/’ between Magazine and bgimage.jpg.

Corrected in V0.5 This is related to an evolution of the pmwiki variable $UploadPrefixFmt which had initially a trailing '/', suppressed from some versions now. I haven't seen the problem due to my own config, sorry.

Another thought about the script. Is there a way to perform the authentication on a group base? That is, when I hit the OK button to apply the customization on a group, I will be challenged for a password, while such password is stored somewhere in the corresponding group’s local configuration file. Thanks,

Good idea, but I need some simple function to check group rights. Page rights are given by the function RetrieveAuthPage but there is no such function for groups. I don't want to write such function which should be in the core.


Hi Pierre,

I’m just trying to install your script but when i start the page “Site.SkinConfig” after while I get this

Fatal error: Maximum execution time of 60 seconds exceeded in D:\xampp\htdocs\!Test\pmwiki.php on line 347

My PmWiki: pmwiki-2.2.0-beta63

In the old version with “skinnice” was no problem.

What is wrong?

What's wrong is the cascading authorization, corrected in V0.7 (in file /local/SkinConfig.php). Recent version of pmWiki have heavily modified the password management system.

User notes? : If you use, used or reviewed "SkinConfig", you can add your name. These statistics appear in the Skins listings and will help newcomers browsing through the wiki.