version=pmwiki-2.2.0-beta68 ordered=1 urlencoded=1 agent=Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 author=simon charset=ISO-8859-1 csum=links ctime=1142577614 host=202.37.32.2 name=PmWiki.CustomizationConcept rev=5 targets=PmWiki.Concept,PmWiki.WikiFarms,PmWiki.LocalCustomizations,PmWiki.Installation,PmWiki.Variables,PmWiki.WikiAdministrator,PmWiki.PmWikiPhilosophy,PmWiki.Internationalizations,PmWiki.OtherLanguages,PmWiki.Skins text=(:Summary:List of PmWiki concepts specifically dealing with customization:)%0a!! PmWiki Customization Concepts%0a%0aThis is a list of PmWiki concepts that specifically deal with customization and is organized in alphabetical order (and can be reused in other Wiki pages on this site). A lot of the terms used on this page are also on this page or on the [[Concept]] page.%0a%0a!!! Local Customization%0a[[#localCustS]]%0aA WikiAdministrator can make a lot of [[local customizations]] simply by setting variables in the @@local/config.php@@ file. Depending on the type of [[installation]] (simple or [[WikiFarms | farm]]), and the type of feature that needs customization, changes in one or more configuration files may be required.%0a%0aFrom its inception, PmWiki has been designed so that [[Wiki Administrator]]s can greatly customize the way PmWiki displays pages and the markup sequences used to generate pages. (This is even mentioned explicitly in [[Pm Wiki Philosophy]] #4.) As a result, the core pmwiki.php script makes extensive use of [[PmWiki.Variables | variables]] to determine how markup sequences will be processed and what each individual page will output.%0a[[#localCustE]]%0a%0a!!! [[Internationalizations]]%0a(:include PmWiki/Internationalizations#include#includeend:)%0a[[Internationalizations]] are available for [[other languages | many languages]].%0a%0a!!! Skin%0a[[#skinS]]%0aA [[skin(s)]] 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 the 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.%0a%0aSo, a skin is just the set of files that determine how pages are displayed in PmWiki. %0aNormally skins are stored as subfolders of @@/pub/skins/@@. Each skin typically has one or more of the following kinds of files:%0a%0a* A template file, such as @@pmwiki.tmpl@@, @@skin.tmpl@@, or @@gemini.tmpl@@. The template is written in HTML or XHTML, and is the framework or 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[[#skinE]]%0a %0a%0a!!! Custom Markup%0a[[#customMarkupS]]%0aPmWiki's markup translation engine is handled by a set of rules; each rule searches for a specific pattern in the markup text and replaces it with some replacement text. Internally, this is accomplished by using PHP's "[[(http://php.net/)preg_replace]]" function.%0a%0aRules are added to the translation engine via PmWiki's Markup() function, which looks like%0a%0a->[@Markup($name, $when, $pattern, $replace);@]%0a%0awhere [@$name@] is a unique name (a string) given to the rule, [@$when@] says when the rule should be applied relative to other rules, [@$pattern@] is the pattern to be searched for in the markup text, and [@$replace@] is what the pattern should be replaced with.%0a%0aFor example, here's the code that creates the rule for [@''emphasized text''@] (in ''scripts/stdmarkup.php''):%0a%0a->[@Markup("em", "inline", "/''(.*?)''/", "%3cem>$1%3c/em>");@]%0a%0aBasically this statement says to create a rule called "em" to be performed with the other "inline" markups, and the rule replaces any text inside two pairs of single quotes with the same text ($1) surrounded by [@%3cem>@] and [@%3c/em>@].%0a%0aThe first two parameters to Markup() are used to specify the sequence in which rules should be applied. The first parameter provides a name for a rule -- "[@em@]" in the example above. We could've chosen other names such as "[@''@]", or even "[@twosinglequotes@]". In general PmWiki uses the markup itself to name the rule (i.e., PmWiki uses "[@''@]" instead of "[@em@]"), but to keep this example easier to read later on we'll use a mnemonic name for now.%0a[[#customMarkupE]]%0a time=1219967415