version=pmwiki-2.1.11 ordered=1 urlencoded=1 agent=Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4 author= csum= host=69.168.86.113 name=PmWiki.Skins rev=29 targets=PmWiki.SkinTemplates,PmWiki.DocumentationIndex,Site.EditQuickReference text=%25audience%25 administrators (basic)%0a!!Contents%0a* [[#what | What is a skin?]]%0a* [[#where | Where do I get skins?]]%0a* [[#use | How do I use a skin?]]%0a* [[#make | How can I make a skin?]]%0a%0a!!What is a skin? [[#what]]%0a%0aA skin is a bunch of files that control what PmWiki pages look like (colors, fonts, borders, etc.) and how they are laid out. The easiest way to understand what a skin does is to try some out using the links below. They lead to this same page (PmWiki.Skins) on the pmwiki.org site, and open in a separate window.%0a%0a* %25target=skin%25[[PmWiki:Skins?skin=beeblebrox-gila2 | BeeblebroxNetGila ]]%0a* %25target=skin%25[[PmWiki:Skins?skin=jhskin | JHSkin ]]%0a* %25target=skin%25[[PmWiki:Skins?skin=gemini | GeminiSkin ]]%0a* %25target=skin%25[[PmWiki:Skins?skin=light | LightSkin ]]%0a* %25target=skin%25[[PmWiki:Skins?skin=monobook | Monobook Skin ]]%0a* %25target=skin%25[[PmWiki:Skins?skin=simple | Simple Skin ]]%0a%0aAs you saw, all skins show the same page contents, but the other elements such as the sidebar, header, and footer, all changed. For example, different skins may display the sidebar on the left, on the right, or even not at all. Some skins have action links and features that others do not, especially if they were designed to take advantage of particular [[cookbook recipes -> Cookbook:Cookbook]].%0a%0aSo, a skin is just the set of files that determine how pages are displayed in PmWiki. Normally skins are stored as subfolders of ''pub/skins/''. Each skin typically has one or more of the following kinds of files:%0a* A template file, such as ''skin.tmpl'' or ''gemini.tmpl''. The template is written in HTML or XHTML, and is the skeleton for the skin. It contains special markers that tell PmWiki where to insert the page's contents.%0a* CSS files, which can control the skin's appearance.%0a* Image files, for decorating a page with images. Common image file formats are .jpg, .png, and .gif.%0a* PHP files, such as ''skin.php''. These let skins provide extra customization setting or capabilities that HTML and CSS alone cannot.%0a* Documentation files, usually something like ''readme.txt'' or ''skinname.txt''. These usually give you information about any special installation steps or nifty features the skin has.%0a%0a!!Where do I get skins? [[#where]]%0a%0aSkins are available in the [[Cookbook:Skins]] collection. The skins in the collection have been contributed by other PmWiki administrators for others to use, and typically have their own set of customization possibilities. When you find a skin you like, follow the link to download the skin package.%0a%0a!!How do I use or install a skin? [[#use]]%0a%0aMost skin packages are .zip, .tgz, or .tar.gz files. You should be able to unpack these with most archiving software.%0a%0a# Unpack the skin to ''pub/skins/'' inside your pmwiki folder. Most well-designed skin packages will create a subfolder in ''pub/skins/'' named after the skin.%0a** If the skin did not make a folder of its own, create one and move the skin files to it.%0a%0a# Open up your ''local/config.php'' file, and add a line like\\%0a\\%0a[@$Skin = 'my-favourite-skin';@]\\%0a\\%0awhere 'my-favourite-skin' is the name of the skin's folder.%0a%0aReload a page from your wiki in the browser, and you should be able to see the difference.%0a%0aIf you'd like to let your site's visitors choose one skin from a selection of skins you've installed, look at the [[Cookbook:SkinChange]] recipe. (That's what we used for the demo above.)%0a%0aThere are a number of ways to further customize the appearance of a skin, including adding statements to /local/config.php that are compatible with your chosen skin; adding css files to /pub/css/, such as local.css (for your entire wiki) and MyGroup.css (for MyGroup); and directly editing the skin's files. If the skin is updated regularly, you probably will want to avoid editing the files in the skin's folder. Check the skin's page in the Cookbook for specific suggestions.%0a%0a!!How can I make a skin? [[#make]]%0a%0aThe best way to make your first skin is to modify a copy of PmWiki's default skin. %0a%0a# Make a copy of the folder ''pub/skins/pmwiki'' and name it whatever your new skin should be named.%0a# In your ''local/config.php'' file, set $Skin to be the name of your new skin.%0a# Modify the template and CSS files to suit you.%0a# Test your new skin.%0a# Repeat steps 3 and 4 until you're happy with the results.%0a%0aThe reason we recommend starting with the default PmWiki skin is that it's quite a simple skin, much more so than many of the skins you'll find in [[Cookbook:Skins]]. The starting point is the template (.tmpl) file, which provides the overall layout of the page. Inside of the template file are a number of special substitutions and directives that provide places for PmWiki to insert the data relevant to the current page being displayed. [[SkinTemplates]] describes the format and directives in more detail.%0a%0aIt's beyond the scope of this page to explain how to write HTML (hypertext markup language), XHTML (extensible HTML, which is a bit newer) or CSS (cascading style sheets), but there are many good tutorials on the web for all three of them. One caution: if you run into an HTML tutorial that explains about how to use %3cfont> or %3cblink> tags, or spacer gifs, it's at least five years out of date, so skip it and find another one. %0a%0aYou should test your skin on a variety of browsers -- ideally as many as you can, on as many different platforms as you can -- but at minimum you should be testing on Internet Explorer 6 and Firefox or Mozilla, since those are the most common, and have different bugs. Don't forget to do things like resize windows and change text size during your testing.%0a%0a!!!Tools that you'll need%0a%0aThere are good examples of all these programs available for free. %0a%0a'''HTML and CSS editor(s).''' There are two types of editors: graphical (WYSIWYG, or "what you see is what you get"), and hand-coding or programmer's editors. Graphical editors are less intimidating to novices, but you won't learn as much, or know your code as intimately as you will by using a hand-coding editor. Whichever you choose, get one that has syntax highlighting for the code, because it will help you spot mistakes. Also, live preview features are not that helpful when writing a PmWiki skin, because PmWiki does stuff that the live preview won't, such as substitute values for variables and insert sidebar content.%0a%0a'''Test wiki'''. You don't want to be wreaking havoc on your skin while visitors can see your site. It's a better idea to set up a test wiki, either on your real webserver or on your own machine. Linux or [=MacOS=] computer owners may have webservers and PHP already running on their machines, but Windows users often don't. If that describes you, then you might want to take a look at the Cookbook:Standalone recipe, which runs PmWiki without needing a complex webserver. Or, you can find many local server packages which install a webserver, PHP, and other stuff (e.g. `MySQL), all configured to work together. Try to get a package that has the same software and versions as used on your live setup, since then there will be less to go wrong when the site goes live.%0a%0a'''FTP client''' to transfer files to your webserver. You probably had one of these already.%0a%0a'''Color picker'''. Your editor might include one, or you could pick up a standalone application. Extremely helpful for creating and saving color palettes.%0a%0a!!See also%0a%0a* [[PmWiki/SkinTemplates]]%0a* [[Cookbook:Skins]]%0a* [[Cookbook:SkinGuidelines]]%0a* [[Cookbook:Standalone]]%0a%0a%25trail%25 %3c%3c|[[Documentation Index]]|>>%0a%0a>>faq%3c%3c [[#faq]]%0a%0aQ: How do I change the Wiki's default name in the upper left corner of the Main Page?%0a%0aA: Put the following config.php%0a%0a->[@$WikiTitle = 'My Wiki Site';@]%0a%0aThe ''docs/sample-config.php'' file has an example of changing the title.%0a%0a%0aQ: How can I embed PmWiki pages inside a web page?%0a%0aA: Source them through a PHP page, or place them in a frame.%0a%0a%0aQ: How do I change the font or background color of the hints block on the Edit Page?%0a%0aA: Add a CSS style to pub/css/local.css: [@.quickref {background:...; color:... }@]. The hints are provided by the [[Site.EditQuickReference]] page, which is in the PmWiki or Site wikigroup. Edit that page, and change the "bgcolor" or specify the font "color" to get the contrast you need.%0a time=1151020170