1head	1.25;
2access;
3symbols;
4locks; strict;
5comment	@# @;
6
7
81.25
9date	2014.05.01.07.55.49;	author TWikiContributor;	state Exp;
10branches;
11next	1.24;
12
131.24
14date	2013.02.15.20.11.31;	author TWikiContributor;	state Exp;
15branches;
16next	1.23;
17
181.23
19date	2013.02.15.20.11.31;	author TWikiContributor;	state Exp;
20branches;
21next	1.22;
22
231.22
24date	2011.08.12.00.35.07;	author TWikiContributor;	state Exp;
25branches;
26next	1.21;
27
281.21
29date	2010.05.29.14.44.39;	author TWikiContributor;	state Exp;
30branches;
31next	1.20;
32
331.20
34date	2008.08.03.22.17.50;	author TWikiContributor;	state Exp;
35branches;
36next	1.19;
37
381.19
39date	2008.01.22.03.21.34;	author TWikiContributor;	state Exp;
40branches;
41next	1.18;
42
431.18
44date	2007.01.16.04.11.59;	author TWikiContributor;	state Exp;
45branches;
46next	1.17;
47
481.17
49date	2006.04.01.05.55.15;	author TWikiContributor;	state Exp;
50branches;
51next	1.16;
52
531.16
54date	2006.02.01.12.01.19;	author TWikiContributor;	state Exp;
55branches;
56next	1.15;
57
581.15
59date	2004.07.25.23.29.00;	author PeterThoeny;	state Exp;
60branches;
61next	1.14;
62
631.14
64date	2003.10.12.18.11.37;	author PeterThoeny;	state Exp;
65branches;
66next	1.13;
67
681.13
69date	2003.10.12.06.15.00;	author PeterThoeny;	state Exp;
70branches;
71next	1.12;
72
731.12
74date	2003.07.26.20.58.00;	author PeterThoeny;	state Exp;
75branches;
76next	1.11;
77
781.11
79date	2003.01.08.07.14.49;	author PeterThoeny;	state Exp;
80branches;
81next	1.10;
82
831.10
84date	2003.01.05.04.59.21;	author PeterThoeny;	state Exp;
85branches;
86next	1.9;
87
881.9
89date	2003.01.04.08.38.00;	author PeterThoeny;	state Exp;
90branches;
91next	1.8;
92
931.8
94date	2001.09.16.05.51.07;	author MikeMannix;	state Exp;
95branches;
96next	1.7;
97
981.7
99date	2001.09.14.08.43.22;	author PeterThoeny;	state Exp;
100branches;
101next	1.6;
102
1031.6
104date	2001.09.10.00.07.45;	author MikeMannix;	state Exp;
105branches;
106next	1.5;
107
1081.5
109date	2001.09.07.10.07.38;	author MikeMannix;	state Exp;
110branches;
111next	1.4;
112
1131.4
114date	2001.08.30.22.08.21;	author MikeMannix;	state Exp;
115branches;
116next	1.3;
117
1181.3
119date	2001.07.15.06.49.40;	author PeterThoeny;	state Exp;
120branches;
121next	1.2;
122
1231.2
124date	2001.03.16.08.59.35;	author PeterThoeny;	state Exp;
125branches;
126next	1.1;
127
1281.1
129date	2001.01.20.23.28.47;	author PeterThoeny;	state Exp;
130branches;
131next	;
132
133
134desc
135@none
136@
137
138
1391.25
140log
141@buildrelease
142@
143text
144@%META:TOPICINFO{author="TWikiContributor" date="1398930949" format="1.1" version="25"}%
145%STARTINCLUDE%
146---+ TWiki Skins
147
148_A skin overlays regular templates to provide specific look and feel to TWiki screens._
149
150%TOC%
151
152---++ Overview
153
154TWiki uses TWikiTemplates files as the basis of all the screens it uses to interact with users. Each screen has an associated template file that contains the basic layout of the screen. This is then filled in by the code to generate what you see in the browser.
155
156TWiki ships with a default set of template files that give a very basic, CSS-themable, look-and-feel. TWiki also includes support for _skins_ that can be selected to give different, more sophisticated, look and feel. A default TWiki installation will usually start up with the PatternSkin already selected. Skins may also be defined by third parties and loaded into a TWiki installation to give more options. To see how TWiki looks when __no__ skin is selected, [[%SCRIPTURL{"view"}%/%WEB%/%TOPIC%?skin=not_a_skin][view the current page with a non-existing skin]].
157
158TWiki topic content is not affected by the choice of skin, however a skin can be defined to use a CSS (Cascading Style Sheet) which can provide a radically different appearance to the text layout.
159
160__Relevant links on TWiki.org:__
161   * TWiki:TWiki.TWikiSkinsSupplement - __%T% tip:__ supplemental documentation on TWiki skins
162   * TWiki:Plugins.SkinPackage - list of all contributed skin packages
163   * TWiki:Plugins.SkinDevelopment - discussion and feedback on contributed skins
164   * TWiki:Plugins.SkinBrainstorming - open forum for new skin ideas
165   * TWiki:Plugins.SkinPackageHowTo - template to create a new skin package
166
167__See other types of extensions:__ TWikiAddOns, TWikiContribs, TWikiPlugins
168
169---++ Changing the default TWiki skin
170
171TWiki ships with the TopMenuSkin activated by default. You can set a skin for the whole site, a single web, a single topic, or for each user individually. This is done by setting the SKIN preferences setting to the name of a skin. If the skin you select doesn't exist, then TWiki will pick up the default templates. For example, to make the SKIN setting work across all topics and webs, put it in %LOCALSITEPREFS%.
172
173Skins can cascade using a [[#ActivatingSkins][skin path]] explained below. One skin can be based on another one, and extensions can introduce additional screen elements. For example, the TagMePlugin adds tag elements to the TopMenuSkin, and the TopMenuSkin is based on the PatternSkin, resulting in this skin path:
174
175<pre>
176   * Set <nop>SKIN = tagme, topmenu, pattern
177</pre>
178
179---++ Defining Skins
180
181You may want to define your own skin, for example to comply with corporate web guidelines, or because you have a aesthetic vision that you want to share. There are a couple of places you can start doing this.
182
183The TWikiTemplates files used for skins are located in the =twiki/templates= directory and are named according to the skin: ==&lt;scriptname&gt;.&lt;skin&gt;.tmpl==. Skin files may also be defined in TWiki topics - see TWikiTemplates for details.
184
185To start creating a new skin, copy the default TWikiTemplates (like =view.tmpl=), or copy an existing skin to use as a base for your own skin. You should only need to copy the files you intend to customize, as TWiki can be configured to fall back to another skin if a template is not defined in your skin. Name the files as described above (for example =view.myskin.tmpl=).
186
187If you use PatternSkin as your starting point, and you want to modify the layout, colors or even the templates to suit your own needs, have a look first at the topics PatternSkinCustomization and PatternSkinCssCookbook.
188
189For your own TWiki skin we encourage you to show a small TWiki logo at the bottom of your skin:
190
191| =&lt;a href="http://twiki.org/"&gt;&lt;img src="%<nop>PUBURL%/%<nop>SYSTEMWEB%/TWikiLogos/T-badge-88x31.gif" alt="This site is powered by the TWiki Enterprise Collaboration Platform" width="88" height="31" title="This site is powered by the TWiki Enterprise Collaboration Platform" border="0" /&gt;&lt;/a&gt;= | <span style="white-space: nowrap;">Renders as:</span>%BR% <a href="http://twiki.org/"><img src="%PUBURL%/%SYSTEMWEB%/TWikiLogos/T-badge-88x31.gif" alt="This site is powered by the TWiki Enterprise Collaboration Platform" width="88" height="31" title="This site is powered by the TWiki Enterprise Collaboration Platform" border="0" /></a> |
192
193%T% __Note:__ TWiki.org has no marketing budget, e.g. we rely on TWiki users to spread the word of TWiki. *You can support the open source project by adding logos that point back to TWiki.org, and by mentioning TWiki in social media.*
194
195The standard TWiki skins show the logo in the =%<nop>WEBCOPYRIGHT%= variable.
196
197__%X% Note:__ Two skin names have _reserved_ meanings; =text= skin, and skin names starting with =rss= have [[#HardCodedSkins][hard-coded meanings]].
198
199The following template files are used for TWiki screens, and are referenced in the TWiki core code. If a skin doesn't define its own version of a template file, then TWiki will fall back to the next skin in the skin path, or finally, to the default version of the template file.
200
201(Certain template files are expected to provide certain TMPL:DEFs - these are listed in sub-bullets)
202   * =addform= - used to select a new form for a topic
203   * =attachagain= - used when refreshing an existing attachment
204   * =attachnew= - used when attaching a new file to a topic
205   * =attachtables= - defines the format of attachments at the bottom of the standard topic view
206      * =ATTACH:files:footer=, =ATTACH:files:header=, =ATTACH:files:row=, =ATTACH:versions:footer=, =ATTACH:versions:header=, =ATTACH:versions:row=
207   * =changeform= - used to change the form in a topic
208   * =changes= - used by the =changes= script
209   * =edit= - used for the edit screen
210   * =form=
211   * =formtables= - used to defined the format of forms
212      * =FORM:display:footer=, =FORM:display:header=, =FORM:display:row=
213   * =login= - used for loggin in when using the !TemplateLoginManager
214      * =LOG_IN=, =LOG_IN_BANNER=, =LOG_OUT=, =LOGGED_IN_BANNER=, =NEW_USER_NOTE=, =UNRECOGNISED_USER=
215   * =moveattachment= - used when moving an attachment
216   * =oopsaccessdenied= - used to format Access Denied messages
217      * =no_such_topic=, =no_such_web=, =only_group=, =topic_access=
218   * =oopsattention= - used to format Attention messages
219      * =already_exists=, =bad_email=, =bad_ver_code=, =bad_wikiname=, =base_web_missing=, =confirm=, =created_web=, =delete_err=, =invalid_web_color=, =invalid_web_name=, =in_a_group=, =mandatory_field=, =merge_notice=, =missing_action=, =missing_fields=, =move_err=, =missing_action=, =no_form_def=, =no_users_to_reset=, =notwikiuser=, =oversized_upload=, =password_changed=, =password_mismatch=, =problem_adding=, =remove_user_done=, =rename_err=, =rename_not_wikiword=, =rename_topic_exists=, =rename_web_err=, =rename_web_exists=, =rename_web_prerequisites=, =reset_bad=, =reset_ok=, =save_error=, =send_mail_error=, =thanks=, =topic_exists=, =unrecognized_action=, =upload_name_changed=, =web_creation_error=, =web_exists=, =web_missing=, =wrong_password=, =zero_size_upload=
220   * =oopschangelanguage= - used to prompt for a new language when internationalisation is enabled
221   * =oopsgeneric= - a basic dialog for user information; provides "ok" button only
222   * =oopslanguagechanged= - used to confirm a new language when internationalisation is enabled
223   * =oopsleaseconflict= - used to format lease Conflict messages
224      * =lease_active=, =lease_old=
225   * =preview= - used for previewing edited topics before saving
226   * =rdiff= - used for viewing topic differences
227   * =registernotify= - used by the user registration system
228   * =registernotifyadmin= - used by the user registration system
229   * =rename= - used when renaming a topic
230   * =renameconfirm= - used when renaming a topic
231   * =renamedelete= - used when renaming a topic
232   * =renameweb= - used when renaming a web
233   * =renamewebconfirm= - used when renaming a web
234   * =renamewebdelete= - used when renaming a web
235   * =searchbookview= - used to format inline search results in book view
236   * =searchformat= - used to format inline search results
237   * =search= - used by the =search= CGI script
238   * =settings=
239   * =view= - used by the =view= CGI script
240   * =viewprint= - used to create the printable view
241
242=twiki.tmpl= is a master template conventionally used by other templates, but not used directly by code.
243
244__%X% Note:__ Make sure templates do not end with a newline. Any newline will expand to an empty =&lt;p /&gt;= in the generated html. It will produce invalid html, and may break the page layout.
245
246---+++ Partial customization, or adding in new features to an existing skin
247
248You can use recursion in the TMPL:INCLUDE chain (e.g. =twiki.pattern.tmpl= contains =%<nop>TMPL:INCLUDE{"twiki"}%=, the templating system will include the next twiki.SKIN in the [[#ActivatingSkins][skin path]] (which is explained below). For example, to create a customization of pattern skin, where you _only_ want to remove the edit & WYSIWYG buttons from view page, you create only a =view.yourlocal.tmpl=:
249<verbatim>
250%TMPL:INCLUDE{"view"}%
251%TMPL:DEF{"edit_topic_link"}%%TMPL:END%
252%TMPL:DEF{"edit_wysiwyg_link"}%%TMPL:END%
253</verbatim>
254and then set =SKIN=yourlocal,pattern=.
255
256---++ Variables in Skins
257
258You can use [[TWikiTemplates#TemplateVariables][template variables]], TWikiVariables, and other predefined variables to compose your skins. Some commonly used variables in skins:
259
260| *Variable:* | *Expanded to:* |
261| =%<nop>WEBLOGONAME%= | Filename of web logo |
262| =%<nop>WEBLOGOIMG%= | Image URL of web logo |
263| =%<nop>WEBLOGOURL%= | Link of web logo |
264| =%<nop>WEBLOGOALT%= | Alt text of web logo |
265| =%<nop>WIKILOGOURL%= | Link of page logo |
266| =%<nop>WIKILOGOIMG%= | Image URL of page logo |
267| =%<nop>WIKILOGOALT%= | Alt text of page logo |
268| =%<nop>WEBBGCOLOR%= | Web-specific background color, defined in the WebPreferences |
269| =%<nop>WIKITOOLNAME%= | The name of your TWiki site |
270| =%<nop>SCRIPTURL%= | The script URL of TWiki |
271| =%<nop>SCRIPTURLPATH%= | The script URL path |
272| =%<nop>SCRIPTSUFFIX%= | The script suffix, ex: =.pl=, =.cgi= |
273| =%<nop>WEB%= | The name of the current web. |
274| =%<nop>TOPIC%= | The name of the current topic. |
275| =%<nop>WEBTOPICLIST%= | Common links of current web, defined in the WebPreferences. It includes a [[#JumpBox][Jump box]] |
276| =%<nop>TEXT%= | The topic text, e.g. the content that can be edited |
277| =%<nop>META{"form"}%= | [[TWikiForms][TWikiForm]], if any |
278| =%<nop>META{"attachments"}%= | FileAttachment table |
279| =%<nop>META{"parent"}%= | The topic parent |
280| =%<nop>EDITTOPIC%= | Edit link |
281| =%<nop>REVTITLE%= | The revision title, if any, ex: =(r1.6)= |
282| =%<nop>REVINFO%= | Revision info, ex: =r1.6 - 24 Dec 2002 - 08:12 GMT - %WIKIUSERNAME%= |
283| =%<nop>WEBCOPYRIGHT%= | Copyright notice, defined in the WebPreferences |
284| =%<nop>BROADCASTMESSAGE%= | Broadcast message at the beginning of your view template, can be used to alert users of scheduled downtimes; can be set in %LOCALSITEPREFS% |
285
286#GoBox
287#JumpBox
288---++ The Jump Box and Navigation Box
289
290The default skins include a [[JumpBox][Jump Box]], to jump to a topic.
291
292The box also understands URLs, e.g. you can type =http://www.google.com/= to jump to an external web site. The feature is handy if you build a skin that has a select box of frequently used links, like Intranet home, employee database, sales database and such. A little <nop>JavaScript gets into action on the =onchange= method of the select tag to fill the selected URL into the "Go" box field, then submits the form.
293
294Here is an example form that has a select box and the Jump Box for illustration purposes. You need to have <nop>JavaScript enabled for this to work:
295
296<form name="sample" action="%SCRIPTURLPATH{"view"}%/%WEB%/%TOPIC%">
297<table border="0" cellpadding="5" bgcolor="#DDDDDD"><tr><td colspan="2">
298Bare bones header, for demo only
299</td></tr><tr><td>
300Navigate:
301</td><td>
302<select name="sel" onchange="this.form.topic.value=this.options[this.selectedIndex].value; this.form.submit()">
303<option selected="selected" value="">...</option>
304<option value="http://twiki.org/">Intranet home</option>
305<option value="%USERSWEB%.UserList">Employee index</option>
306<option value="%USERSWEB%.%HOMETOPIC%">%USERSWEB% web</option>
307<option value="%SYSTEMWEB%.%HOMETOPIC%">%SYSTEMWEB% web</option>
308<option value="http://www.google.com/">Google</option>
309<option value="http://www.yahoo.com/">Yahoo!</option>
310</select>
311</td></tr><tr><td>
312Jump:
313</td><td>
314<input type="text" name="topic" size="16" />
315</td></tr></table>
316</form>
317
318__Note:__ Redirect to a URL only works if it is enabled in =configure= (Miscellaneous, ={AllowRedirectUrl}=).
319
320---++ Using Cascading Style Sheets
321
322CSS files are gererally attachments to the skin topic that are included in the the skin templates - in the case of PatternSkin in the template =styles.pattern.tmpl=.
323
324   * To see how CSS is used in the default TWiki skin, see: PatternSkin
325   * If you write a complete new skin, this is the syntax to use in a template file:
326<verbatim>
327<style type='text/css' media='all'>@@import url('%PUBURLPATH%/%SYSTEMWEB%/MySkin/mystyle.css');</style>
328</verbatim>
329
330---++ Attachment Tables
331Controlling the look and feel of attachment tables is a little bit more complex than for the rest of a skin. By default, the attachment table is a standard TWiki table, and the look is controlled in the same way as other tables. In a very few cases you may want to change the _content_ of the table as well.
332
333The format of standard attachment tables is defined through the use of special _TWiki template macros_ which by default, are defined in the =attachtables.tmpl= template using the =%TMPL:DEF= macro syntax described in TWikiTemplates. These macros are:
334| *Macro* | *Description* |
335| =ATTACH:files:header= | Standard title bar |
336| =ATTACH:files:row= | Standard row |
337| =ATTACH:files:footer= | Footer for all screens |
338| =ATTACH:files:header:A= | Title bar for upload screens, with attributes column |
339| =ATTACH:files:row:A= | Row for upload screen |
340| =ATTACH:files:footer:A= | Footer for all screens |
341
342The format of tables of file versions in the Upload screen can also be changed, using the macros:
343| *Macro* | *Description* |
344| =ATTACH:versions:header= | Header for versions table on upload screen |
345| =ATTACH:versions:row= | Row format for versions table on upload screen |
346| =ATTACH:versions:footer= | Footer for versions table on upload screen |
347
348The =ATTACH:row= macros are expanded for each file in the attachment table, using the following special tags:
349| *Tag* | *Description* |
350| =%A_URL%= | =viewfile= URL that will recover the file |
351| =%A_REV%= | Revision of this file |
352| =%A_ICON%= | A file icon suitable for representing the attachment content |
353| =%A_FILE%= | The name of the file. To get the 'pub' url of the file, use =%<nop>PUBURL%/%<nop>WEB%/%<nop>TOPIC%/%<nop>A_FILE%= |
354| =%A_SIZE%= | The size of the file |
355| =%A_DATE%= | The date the file was uploaded |
356| =%A_USER%= | The user who uploaded it |
357| =%A_COMMENT%= | The comment they put in when uploading it |
358| =%A_ATTRS%= | The attributes of the file as seen on the upload screen e.g "h" for a hidden file |
359
360---++ Packaging and Publishing Skins
361
362See TWiki:Plugins/SkinPackagingHowTo and TWiki:Plugins/SkinDeveloperFAQ
363
364---++ Browsing Installed Skins
365
366You can try out all installed skins in the TWikiSkinBrowser.
367
368#ActivatingSkins
369---++ Activating Skins
370
371TWiki uses a _skin search path_, which lets you combine skins additively. The skin path is defined using a combination of TWikiVariables and URL parameters.
372
373TWiki works by asking for a template for a particular function - for example, 'view'. The detail of how templates are searched for is described in TWikiTemplates, but in summary, the templates directory is searched for a file called <code>view.</code><i>skin</i><code>.tmpl</code>, where _skin_ is the name of the skin e.g. =pattern=. If no template is found, then the fallback is to use =view.tmpl=. Each skin on the path is searched for in turn. For example, if you have set the skin path to =local,pattern= then =view.local.tmpl= will be searched for first, then =view.pattern.tmpl= and finally =view.tmpl=.
374
375The basic skin is defined by a =SKIN= setting:
376
377   * =Set SKIN = catskin, bearskin=
378
379You can also add a parameter to the URL, such as =?skin=catskin,bearskin=:
380
381   * %SCRIPTURL{view}%/%WEB%/%TOPIC%?skin=catskin,bearskin
382
383Setting =SKIN= (or the =?skin= parameter in the URL) replaces the existing skin path setting, for the current page only. You can also _extend_ the existing skin path as well, using _covers_.
384
385   * =Set COVER = ruskin=
386
387This pushes a different skin to the front of the skin search path (so for our example above, that final skin path will be =ruskin, catskin, bearskin=). There is also an equivalent =cover= URL parameter. The difference between setting =SKIN= vs. =COVER= is that if the chosen template is not found (e.g., for included templates), =SKIN= will fall back onto the next skin in line, or the default skin, if only one skin was present, while =COVER= will always fall back onto the current skin.
388
389An example would be invoking the printable mode, which is achieved by applying =?cover=print=. The =view.print.tmpl= simply invokes the =viewprint= template for the current skin which then can appropriately include all other used templates for the current skin. Where the printable mode be applied by using =SKIN=, all skins would have the same printable appearance.
390
391The full skin path is built up as follows: =SKIN= setting (or =?skin= if it is set), then =COVER= setting is added, then =?cover=.
392
393#ConditionalSkin
394---++ Conditional Skin Activation
395
396TWiki skins can be activated conditionally using IfStatements. For example, you might want to use a mobile skin for iPhone and Android user agents, and the default skin otherwise. This example uses the print skin on iPhone and Android:
397
398<pre>
399   * Set <nop>SKIN = %<nop>IF{
400      "'%<nop>HTTP{"User-Agent"}%'~'*iPhone*' OR '%<nop>HTTP{"User-Agent"}%'~'*Android*'"
401      then="print, pattern"
402      else="topmenu, pattern"
403     }%
404</pre>
405
406#HardCodedSkins
407---++ Hard-Coded Skins
408
409The =text= skin is reserved for TWiki internal use.
410
411Skin names starting with =rss= also have a special meaning; if one or more of the skins in the skin path starts with 'rss' then 8-bit characters will be encoded as XML entities in the output, and the =content-type= header will be forced to =text/xml=.
412
413__Related Topics:__ TWikiSkinBrowser, AdminDocumentationCategory, DeveloperDocumentationCategory, TWiki:TWiki.TWikiSkinsSupplement
414
415-- __Contributors:__ TWiki:Main.PeterThoeny, TWiki:Main.MikeMannix, TWiki:Main.CrawfordCurrie
416@
417
418
4191.24
420log
421@buildrelease
422@
423text
424@d1 1
425a1 1
426%META:TOPICINFO{author="TWikiContributor" date="1360959091" format="1.1" version="24"}%
427d28 1
428a28 1
429TWiki ships with the TopMenuSkin activated by default. You can set a skin for the whole site, a single web, a single topic, or for each user individually. This is done by setting the SKIN preferences setting to the name of a skin. If the skin you select doesn't exist, then TWiki will pick up the default templates. For example, to make the SKIN setting work across all topics and webs, put it in Main.TWikiPreferences.
430d46 1
431a46 1
432For your own TWiki skin you are encouraged to show a small 80x31 pixel <a href="http://twiki.org/"><img src="%PUBURL%/%SYSTEMWEB%/TWikiLogos/T-logo-80x15.gif" alt="This site is powered by the TWiki collaboration platform" width="80" height="15" title="This site is powered by the TWiki collaboration platform" border="0" /></a> logo at the bottom of your skin:
433d48 3
434a50 1
435=&lt;a href="http://twiki.org/"&gt;&lt;img src="%<nop>PUBURL%/%<nop>SYSTEMWEB%/TWikiLogos/T-logo-80x15.gif" alt="This site is powered by the TWiki collaboration platform" width="80" height="15" title="This site is powered by the TWiki collaboration platform" border="0" /&gt;&lt;/a&gt;=
436@
437
438
4391.23
440log
441@buildrelease
442@
443text
444@d1 1
445a1 1
446%META:TOPICINFO{author="TWikiContributor" date="1360959091" format="1.1" version="23"}%
447d248 13
448@
449
450
4511.22
452log
453@buildrelease
454@
455text
456@d1 1
457a1 1
458%META:TOPICINFO{author="TWikiContributor" date="1313109307" format="1.1" version="22"}%
459d5 1
460a5 1
461_Skins overlay regular templates to give different looks and feels to TWiki screens._
462d13 1
463a13 1
464TWiki ships with a default set of template files that give a very basic, CSS-themable, look-and-feel. TWiki also includes support for _skins_ that can be selected to give different, more sophisticated, look and feels. A default TWiki installation will usually start up with the PatternSkin already selected. Skins may also be defined by third parties and loaded into a TWiki installation to give more options. To see how TWiki looks when *no* skin is selected, [[%SCRIPTURL{"view"}%/%WEB%/%TOPIC%?skin=not_a_skin][view this topic with a non-existant skin]].
465d15 1
466a15 1
467Topic text is not affected by the choice of skin, though a skin can be defined to use a CSS (Cascading Style Sheet), which can sometimes give a radically different appearance to the text.
468d28 7
469a34 1
470TWiki default ships with the skin PatternSkin activated. You can set the skin for the whole site, a single web or topic, or for each user individually, by setting the SKIN variable to the name of a skin. If the skin you select doesn't exist, then TWiki will pick up the default templates.
471d42 1
472a42 1
473To start creating a new skin, copy the default TWikiTemplates (like =view.tmpl=), or copy an existing skin to use as a base for your own skin. You should only need to copy the files you intend to customise, as TWiki can be configured to fall back to another skin if a template is not defined in your skin. Name the files as described above (for example =view.myskin.tmpl=.
474d96 1
475a96 1
476
477d101 1
478a101 1
479---+++ Partial customisation, or adding in new features to an existing skin
480d103 1
481a103 2
482You can use recusion in the TMPL:INCLUDE chain (eg twiki.classic.tmpl contains =%<nop>TMPL:INCLUDE{"twiki"}%=, the templating system will include the next twiki.SKIN in the skin path.
483For example, to create a customisation of pattern skin, where you _only_ want to remove the edit & WYSIWYG buttons from view page, you create only a =view.yourlocal.tmpl=:
484a110 2
485Because ClassicSkin and the default templates use the same Template definition names, you can over-ride the edit links in them (or any skin derived from them) using the same =view.yourlocal.tmpl= (just set SKIN=yourlocal,classic either in %USERSWEB%.TWikiPreferences for globally, or a Web's <nop>Webname.<nop>WebPreferences for a particular web)
486
487d223 1
488@
489
490
4911.21
492log
493@buildrelease
494@
495text
496@d1 1
497a1 1
498%META:TOPICINFO{author="TWikiContributor" date="1273873869" format="1.1" version="21"}%
499d32 1
500a32 1
501You may want to define your own skin, for example to comply with corporate web guidelines, or because you have a aesthetic vision that you want to share. There are a couple of places you an start doing this.
502d157 1
503a157 1
504<option value="%USERSWEB%.%WIKIUSERSTOPIC%">Employee index</option>
505@
506
507
5081.20
509log
510@buildrelease
511@
512text
513@d1 1
514a1 1
515%META:TOPICINFO{author="TWikiContributor" date="1168736701" format="1.1" version="20"}%
516d127 1
517a127 1
518| =%<nop>WEBTOPICLIST%= | Common links of current web, defined in the WebPreferences. It includes a [[#GoBox][Go box]] |
519d139 2
520a140 1
521---++ The "Go" Box and Navigation Box
522d142 1
523a142 1
524The default skins include a [[GoBox]["Go" box]], also called "Jump" box, to jump to a topic.
525d146 1
526a146 1
527Here is an example form that has a select box and the "Go" box for illustration purposes. You need to have <nop>JavaScript enabled for this to work:
528@
529
530
5311.19
532log
533@buildrelease
534@
535text
536@d1 1
537a1 1
538%META:TOPICINFO{author="TWikiContributor" date="1168736701" format="1.1" version="19"}%
539d93 1
540a93 2
541
542__%X% Note:__ It is best to create these templates for your skin. If you =TMPL:INCLUDE= the default templates, or templates from other skins, when you are defining your own skin, you run the risk that the included file might change and break your skin.
543@
544
545
5461.18
547log
548@buildrelease
549@
550text
551@d1 1
552a1 2
553%META:TOPICINFO{author="TWikiContributor" date="1168736701" format="1.1" version="18"}%
554%TOC%
555d3 1
556a3 1
557---# TWiki Skins
558d7 2
559d13 1
560a13 1
561TWiki ships with a default set of template files that give a basic look-and-feel. TWiki also includes support for _skins_ that can be selected to give different, more sophisticated, look and feels. A default TWiki installation will usually start up with the PatternSkin already selected. Skins may also be defined by third parties and loaded into a TWiki installation to give more options. To see how TWiki looks when *no* skin is selected, [[%SCRIPTURL{"view"}%/%WEB%/%TOPIC%?skin=not_a_skin][view this topic with a non-existant skin]].
562d28 1
563a28 1
564TWiki default ships with the skin PatternSkin activated. If you want to modify the layout, colors or even the templates to suit your own needs, have a look first at the topics PatternSkinCustomization and PatternSkinCssCookbook.
565d32 1
566a32 1
567You may want to define your own skin, for example to comply with corporate web guidelines, or because you have a aesthetic vision that you want to share.
568d38 3
569a40 1
570For your own TWiki skin you are encouraged to show a small 80x31 pixel <a href="http://twiki.org/"><img src="%PUBURL%/%TWIKIWEB%/TWikiLogos/T-logo-80x15.gif" alt="This site is powered by the TWiki collaboration platform" width="80" height="15" title="This site is powered by the TWiki collaboration platform" border="0" /></a> logo at the bottom of your skin:
571d42 1
572a42 1
573=&lt;a href="http://twiki.org/"&gt;&lt;img src="%<nop>PUBURL%/%<nop>TWIKIWEB%/TWikiLogos/T-logo-80x15.gif" alt="This site is powered by the TWiki collaboration platform" width="80" height="15" title="This site is powered by the TWiki collaboration platform" border="0" /&gt;&lt;/a&gt;=
574d107 1
575a107 1
576Because ClassicSkin and the default templates use the same Template definition names, you can over-ride the edit links in them (or any skin derived from them) using the same =view.yourlocal.tmpl= (just set SKIN=yourlocal,classic either in %MAINWEB%.TWikiPreferences for globally, or a Web's <nop>Webname.<nop>WebPreferences for a particular web)
577d157 3
578a159 3
579<option value="%MAINWEB%.%WIKIUSERSTOPIC%">Employee index</option>
580<option value="%MAINWEB%.%HOMETOPIC%">%MAINWEB% web</option>
581<option value="%TWIKIWEB%.%HOMETOPIC%">%TWIKIWEB% web</option>
582d179 1
583a179 1
584<style type='text/css' media='all'>@@import url('%PUBURLPATH%/%TWIKIWEB%/MySkin/mystyle.css');</style>
585d202 1
586a202 1
587| =%A_URL%= | URL that will recover the file |
588d205 1
589a205 1
590| =%A_FILE%= | The name of the file |
591@
592
593
5941.17
595log
596@buildrelease
597@
598text
599@d1 1
600a1 1
601%META:TOPICINFO{author="TWikiContributor" date="1111929255" format="1.0" version="17"}%
602d16 8
603a23 1
604__%T% Tip:__ TWiki:TWiki.TWikiSkinsSupplement on TWiki.org has supplemental documentation on TWiki Skins.
605d33 1
606a33 1
607The TWikiTemplates files used for skins are located in the =twiki/templates= directory and are named according to the skin: ==&lt;scriptname&gt;.&lt;skin&gt;.tmpl==. For example, the template used for pages generated by the =view= script with the =print= skin selected is =view.print.tmpl= (this is how the *Printable* control is implemented). Skin files may also be defined in TWiki topics - see TWikiTemplates for details.
608d37 6
609d67 1
610d86 2
611d90 15
612a104 1
613__%X% Note:__ You are strongly recommended *not* to =TMPL:INCLUDE= the default templates, or templates from other skins, when you are defining your own skin. If you do, you run the risk that the included file might change and break your skin.
614d137 1
615a137 1
616---+++ The "Go" Box and Navigation Box
617d139 3
618a141 1
619The default =%<nop>WEBTOPICLIST%= includes a "Go" box, also called "Jump" box, to jump to a topic. The box also understands URLs, e.g. you can type http://www.google.com/ to jump to an external web site. The feature is handy if you build a skin that has a select box of frequently used links, like Intranet home, employee database, sales database and such. A little <nop>JavaScript gets into action on the onSelect method of the select tag to fill the selected URL into the "Go" box field, then submits the form.
620d146 5
621a150 1
622<table border="3"><tr><td>
623d152 8
624a159 9
625 <option selected="selected" value="">Navigate...</option>
626 <option value="http://www.twiki.org/">Intranet home</option>
627 <option value="%MAINWEB%.%WIKIUSERSTOPIC%">Employee index</option>
628 <option value="%MAINWEB%.%HOMETOPIC%">%MAINWEB% web</option>
629 <option value="%TWIKIWEB%.%HOMETOPIC%">%TWIKIWEB% web</option>
630 <option value="http://www.google.com/">Google</option>
631 <option value="http://www.yahoo.com/">Yahoo!</option>
632 </select>
633Bare bones header for demo only
634d161 3
635a163 1
636%WEBTOPICLIST%
637d166 3
638a168 1
639
640d171 1
641a171 1
642CSS is used by PatternSkin, the TWiki skin that is selected in new installations. See that skin topic for information how CSS is used.
643d173 2
644a174 3
645CSS files are gererally attachments to the skin topic that are included in the the skin templates - in the case of PatternSkin in the template =css.pattern.tmpl=.
646
647Write in your main template:
648d227 1
649a227 1
650You can also add a parameter to the URL, such as =?skin=catskin, bearskin=. Example activation of PrintSkin that generates a printable page:
651d229 1
652a229 1
653   * %SCRIPTURL{view}%/%WEB%/%TOPIC%?skin=print
654d231 1
655a231 1
656Setting =SKIN= (or the =?skin= parameter in the URL) replaces the existing skin path setting. You can also _extend_ the existing skin path as well, using _covers_.
657d235 3
658a237 1
659This pushes a different skin to the front of the skin search path (so for our example above, that final skin path will be =ruskin, catskin, bearskin=). There is also an equivalent =cover= URL parameter.
660@
661
662
6631.16
664log
665@buildrelease
666@
667text
668@d1 1
669a1 1
670%META:TOPICINFO{author="TWikiContributor" date="1111929255" format="1.0" version="16"}%
671d35 37
672a71 37
673	* =addform= - used to select a new form for a topic
674	* =attachagain= - used when refreshing an existing attachment
675	* =attachnew= - used when attaching a new file to a topic
676	* =attachtables= - defines the format of attachments at the bottom of the standard topic view
677		* =ATTACH:files:footer=, =ATTACH:files:header=, =ATTACH:files:row=, =ATTACH:versions:footer=, =ATTACH:versions:header=, =ATTACH:versions:row=
678	* =changeform= - used to change the form in a topic
679	* =changes= - used by the =changes= script
680	* =edit= - used for the edit screen
681	* =form=
682	* =formtables= - used to defined the format of forms
683		* =FORM:display:footer=, =FORM:display:header=, =FORM:display:row=
684	* =login= - used for loggin in when using the !TemplateLoginManager
685		* =LOG_IN=, =LOG_IN_BANNER=, =LOG_OUT=, =LOGGED_IN_BANNER=, =NEW_USER_NOTE=, =UNRECOGNISED_USER=
686	* =moveattachment= - used when moving an attachment
687	* =oopsaccessdenied= - used to format Access Denied messages
688		* =no_such_topic=, =no_such_web=, =only_group=, =topic_access=
689	* =oopsattention= - used to format Attention messages
690		* =already_exists=, =bad_email=, =bad_ver_code=, =bad_wikiname=, =base_web_missing=, =confirm=, =created_web=, =delete_err=, =invalid_web_color=, =invalid_web_name=, =in_a_group=, =mandatory_field=, =merge_notice=, =missing_action=, =missing_fields=, =move_err=, =missing_action=, =no_form_def=, =no_users_to_reset=, =notwikiuser=, =oversized_upload=, =password_changed=, =password_mismatch=, =problem_adding=, =remove_user_done=, =rename_err=, =rename_not_wikiword=, =rename_topic_exists=, =rename_web_err=, =rename_web_exists=, =rename_web_prerequisites=, =reset_bad=, =reset_ok=, =save_error=, =send_mail_error=, =thanks=, =topic_exists=, =unrecognized_action=, =upload_name_changed=, =web_creation_error=, =web_exists=, =web_missing=, =wrong_password=, =zero_size_upload=
691	* =oopschangelanguage= - used to prompt for a new language when internationalisation is enabled
692	* =oopslanguagechanged= - used to confirm a new language when internationalisation is enabled
693	* =oopsleaseconflict= - used to format lease Conflict messages
694		* =lease_active=, =lease_old=
695	* =preview= - used for previewing edited topics before saving
696	* =rdiff= - used for viewing topic differences
697	* =registernotify= - used by the user registration system
698	* =registernotifyadmin= - used by the user registration system
699	* =rename= - used when renaming a topic
700	* =renameconfirm= - used when renaming a topic
701	* =renamedelete= - used when renaming a topic
702	* =renameweb= - used when renaming a web
703	* =renamewebconfirm= - used when renaming a web
704	* =renamewebdelete= - used when renaming a web
705	* =searchbookview= - used to format inline search results in book view
706	* =searchformat= - used to format inline search results
707	* =search= - used by the =search= CGI script
708	* =settings=
709	* =view= - used by the =view= CGI script
710d104 1
711a104 1
712| =%<nop>BROADCASTMESSAGE%= | Broadcast message at the beginning of your view template, can be used to alert users of scheduled downtimes; can be set in %MAINWEB%.TWikiPreferences |
713d187 1
714a187 1
715	* =Set SKIN = catskin, bearskin=
716d191 1
717a191 1
718	* %SCRIPTURL{view}%/%WEB%/%TOPIC%?skin=print
719d195 1
720a195 1
721	* =Set COVER = ruskin=
722@
723
724
7251.15
726log
727@none
728@
729text
730@d1 1
731a1 1
732%META:TOPICINFO{author="PeterThoeny" date="1090798140" format="1.0" version="1.15"}%
733d6 1
734a6 1
735_Skins overlay regular templates with alternate header/footer layouts; topic text is not affected_
736d10 11
737a20 1
738Skins are customized TWikiTemplates files. You can use skins to change the look of a %WIKITOOLNAME% topic, for example, the layout of the header and footer. Rendered text between header and footer does __not__ change. You can also use skins to define an alternate view, like a view optimized for printing.
739d24 5
740a28 1
741Skin files are located in the =twiki/templates= directory and are named with the syntax: ==&lt;scriptname&gt;.&lt;skin&gt;.tmpl==. For example, the *Printable* skin for the =view= template is =view.print.tmpl=.
742d30 45
743a74 1
744Use the existing TWikiTemplates (like =view.tmpl=) or skin files as a base for your own skin, name it for example =view.myskin.tmpl=.
745d81 4
746d88 1
747a88 1
748| =%<nop>WEBBGCOLOR%= | Web specific background color, defined in the WebPreferences |
749d91 1
750d93 3
751a95 3
752| =%<nop>WEB%= | The name of the current web. __Note:__ It is recommended to URL-encode the variable in form actions with =%<nop>INTURLENCODE{"%<nop>WEB%"}%= for proper handling in an internationalized environment |
753| =%<nop>TOPIC%= | The name of the current topic. __Note:__ It is recommended to URL-encode the variable in form actions with =%<nop>INTURLENCODE{"%<nop>TOPIC%"}%= for proper handling in an internationalized environment |
754| =%<nop>WEBTOPICLIST%= | Common links of current web, defined in the WebPreferences. It includes a [[#GoBox]] |
755d104 1
756a104 1
757| =%<nop>BROADCASTMESSAGE%= | Broadcast message at the beginning of your view template, can be used to alert users of scheduled downtimes; is set in TWikiPreferences |
758d109 1
759a109 1
760The =%<nop>WEBTOPICLIST%= includes a "Go" box to jump to a topic. The box also understand URLs, e.g. you can type http://www.google.com/ to jump to an external web site. The feature is handy if you build a skin that has a select box of frequently used links, like Intranet home, employee database, sales database and such. A little <nop>JavaScript gets into action on the onSelect method of the select tag to fill the selected URL into the "Go" box field, then submits the form.
761d113 1
762a113 1
763<form name="sample" action="%SCRIPTURL%/view%SCRIPTSUFFIX%/%INTURLENCODE{"%WEB%/%TOPIC%"}%">
764d129 1
765a129 1
766
767d132 1
768a132 1
769Although work is underway at TWiki:Codev.CssClassNames, the regular templates files currently do not use style sheets.  Many skin developers, however, choose to use them; it helps in separating style from content.
770d134 1
771a134 1
772Example: To use a style sheet for the broadcast message, add this to =view.myskin.tmpl=:
773d136 1
774d138 1
775a138 13
776<style type="text/css">
777.broadcastmessage {
778	 background: yellow; display:block;
779	 border-style:solid;border-width: 2px;border-color:red;
780}
781.broadcastmessage strong {color: red}
782</style>
783</verbatim>
784
785Then add a div tag to the =%<nop>BROADCASTMESSAGE%= variable located after the =#PageTop= anchor or after the opening form tag:
786
787<verbatim>
788<div class="broadcastmessage"> %BROADCASTMESSAGE% </div>
789d142 1
790a142 1
791Controlling the look and feel of attachment tables is a little bit more complex than for the rest of a skin. By default the attachment table is a standard TWiki table, and the look is controlled in the same ay as other tables. In a very few cases you may want to change the _content_ of the table as well.
792d144 1
793a144 1
794The format of standard attachment tables is defined through the use of special _TWiki template macros_ which by default are defined in the =templates/twiki.tmpl= template using the =%TMPL:DEF= macro syntax described in TWikiTemplates. These macros are:
795d152 2
796a153 1
797The format of tables of file versions in the Upload screen are also formattable, using the macros:
798d162 1
799a162 1
800| =%A_REV%= | Revision of this file e.g. "1.1" |
801a170 2
802Note: it is easy to change the look and feel for an entire site by editing the =twiki.tmpl= template file. However, to simplify upgrading, you should avoid doing this. Instead, write a skin-specific template file e.g. =attach.myskin.tmpl= and use =%TMPL:INCLUDE{attach.myskin.tmpl}%= to include it in each of your skin files. As long as it it included _after_ twiki.tmpl, your macro definitions will override the defaults defined there.
803
804d177 1
805a177 1
806You can try all installed skins in TWikiSkinBrowser.
807d181 19
808a199 1
809A skin can be activated in two ways:
810d201 2
811a202 2
812	* Define the =SKIN= Preference variable in TWiki.TWikiPreferences, one of the WebPreferences, or in a user - %WIKIUSERNAME% - topic.
813		* =Set SKIN = print=
814d204 1
815a204 3
816	* Add =?skin=name= to the URL, for this example:
817		* %SCRIPTURL%/view%SCRIPTSUFFIX%/%WEB%/%TOPIC%?skin=print (for the print view skin)
818		* %SCRIPTURL%/view%SCRIPTSUFFIX%/%WEB%/%TOPIC%?skin=plain (for the plain view skin that has no header and footer)
819d206 1
820a206 1
821The ==?skin=name== URL parameter overrides the SKIN Preference value.
822d208 1
823a208 2
824-- TWiki:Main.PeterThoeny - 25 Jul 2004 %BR%
825-- TWiki:Main.CrawfordCurrie - 30 Jun 2004 %BR%
826d210 1
827@
828
829
8301.14
831log
832@none
833@
834text
835@d1 143
836a143 106
837%META:TOPICINFO{author="PeterThoeny" date="1065982296" format="1.0" version="1.14"}%
838%TOC%
839%STARTINCLUDE%
840---# TWiki Skins
841
842_Skins overlay regular templates with alternate header/footer layouts; topic text is not affected_
843
844---++ Overview
845
846Skins are customized TWikiTemplates files. You can use skins to change the look of a %WIKITOOLNAME% topic, for example, the layout of the header and footer. Rendered text between header and footer does __not__ change. You can also use skins to define an alternate view, like a view optimized for printing.
847
848---++ Defining Skins
849
850Skin files are located in the =twiki/templates= directory and are named with the syntax: ==&lt;scriptname&gt;.&lt;skin&gt;.tmpl==. For example, the *Printable* skin for the =view= template is =view.print.tmpl=.
851
852Use the existing TWikiTemplates (like =view.tmpl=) or skin files as a base for your own skin, name it for example =view.myskin.tmpl=.
853
854---++ Variables in Skins
855
856You can use [[TWikiTemplates#TemplateVariables][template variables]], TWikiVariables, and other predefined variables to compose your skins. Some commonly used variables in skins:
857
858| *Variable:* | *Expanded to:* |
859| =%<nop>WIKILOGOURL%= | Link of page logo |
860| =%<nop>WIKILOGOIMG%= | Image URL of page logo |
861| =%<nop>WIKILOGOALT%= | Alt text of page logo |
862| =%<nop>WEBBGCOLOR%= | Web specific background color, defined in the WebPreferences |
863| =%<nop>WIKITOOLNAME%= | The name of your TWiki site |
864| =%<nop>SCRIPTURL%= | The script URL of TWiki |
865| =%<nop>SCRIPTSUFFIX%= | The script suffix, ex: =.pl=, =.cgi= |
866| =%<nop>WEB%= | The name of the current web. __Note:__ It is recommended to URL-encode the variable in form actions with =%<nop>INTURLENCODE{"%<nop>WEB%"}%= for proper handling in an internationalized environment |
867| =%<nop>TOPIC%= | The name of the current topic. __Note:__ It is recommended to URL-encode the variable in form actions with =%<nop>INTURLENCODE{"%<nop>TOPIC%"}%= for proper handling in an internationalized environment |
868| =%<nop>WEBTOPICLIST%= | Common links of current web, defined in the WebPreferences. It includes a [[#GoBox]] |
869| =%<nop>TEXT%= | The topic text, e.g. the content that can be edited |
870| =%<nop>META{"form"}%= | [[TWikiForms][TWikiForm]], if any |
871| =%<nop>META{"attachments"}%= | FileAttachment table |
872| =%<nop>META{"parent"}%= | The topic parent |
873| =%<nop>EDITTOPIC%= | Edit link |
874| =%<nop>REVTITLE%= | The revision title, if any, ex: =(r1.6)= |
875| =%<nop>REVINFO%= | Revision info, ex: =r1.6 - 24 Dec 2002 - 08:12 GMT - %WIKIUSERNAME%= |
876| =%<nop>WEBCOPYRIGHT%= | Copyright notice, defined in the WebPreferences |
877| =%<nop>BROADCASTMESSAGE%= | Broadcast message at the beginning of your view template, can be used to alert users of scheduled downtimes; is set in TWikiPreferences |
878
879#GoBox
880---+++ The "Go" Box and Navigation Box
881
882The =%<nop>WEBTOPICLIST%= includes a "Go" box to jump to a topic. The box also understand URLs, e.g. you can type http://www.google.com/ to jump to an external web site. The feature is handy if you build a skin that has a select box of frequently used links, like Intranet home, employee database, sales database and such. A little <nop>JavaScript gets into action on the onSelect method of the select tag to fill the selected URL into the "Go" box field, then submits the form.
883
884Here is an example form that has a select box and the "Go" box for illustration purposes. You need to have <nop>JavaScript enabled for this to work:
885
886<form name="sample" action="%SCRIPTURL%/view%SCRIPTSUFFIX%/%INTURLENCODE{"%WEB%/%TOPIC%"}%">
887<table border="3"><tr><td>
888<select name="sel" onchange="this.form.topic.value=this.options[this.selectedIndex].value; this.form.submit()">
889 <option selected="selected" value="">Navigate...</option>
890 <option value="http://www.twiki.org/">Intranet home</option>
891 <option value="%MAINWEB%.%WIKIUSERSTOPIC%">Employee index</option>
892 <option value="%MAINWEB%.%HOMETOPIC%">%MAINWEB% web</option>
893 <option value="%TWIKIWEB%.%HOMETOPIC%">%TWIKIWEB% web</option>
894 <option value="http://www.google.com/">Google</option>
895 <option value="http://www.yahoo.com/">Yahoo!</option>
896 </select>
897Bare bones header for demo only
898</td></tr><tr><td>
899%WEBTOPICLIST%
900</td></tr></table>
901</form>
902
903---++ Using Cascading Style Sheets
904
905The regular templates files currently do not use style sheets. Many skin developers choose to use them, it helps in separating style from content.
906
907Example: To use a style sheet for the broadcast message, add this to =view.myskin.tmpl=:
908
909<verbatim>
910<style type="text/css">
911.broadcastmessage {
912	 background: yellow; display:block;
913	 border-style:solid;border-width: 2px;border-color:red;
914}
915.broadcastmessage strong {color: red}
916</style>
917</verbatim>
918
919Then add a div tag to the =%<nop>BROADCASTMESSAGE%= variable located after the =#PageTop= anchor or after the opening form tag:
920
921<verbatim>
922<div class="broadcastmessage"> %BROADCASTMESSAGE% </div>
923</verbatim>
924
925---++ Packaging and Publishing Skins
926
927See TWiki:Plugins/SkinPackagingHowTo and TWiki:Plugins/SkinDeveloperFAQ
928
929---++ Activating Skins
930
931A skin can be activated in two ways:
932
933	* Define the =SKIN= Preference variable in TWiki.TWikiPreferences, one of the WebPreferences, or in a user - %WIKIUSERNAME% - topic.
934		* =Set SKIN = print=
935
936	* Add =?skin=name= to the URL, for this example:
937		* %SCRIPTURL%/view%SCRIPTSUFFIX%/%WEB%/%TOPIC%?skin=print (for the print view skin)
938		* %SCRIPTURL%/view%SCRIPTSUFFIX%/%WEB%/%TOPIC%?skin=plain (for the plain view skin that has no header and footer)
939
940The ==?skin=name== URL parameter overrides the SKIN Preference value.
941
942-- PeterThoeny - 05 Jan 2003
943@
944
945
9461.13
947log
948@none
949@
950text
951@d1 1
952a1 1
953%META:TOPICINFO{author="PeterThoeny" date="1065939300" format="1.0" version="1.13"}%
954d41 1
955a41 1
956| =%<nop>BROADCASTMESSAGE%= | Broadcast message at the beginning of your view template, can be used to alert users of scheduled downtimes; is defined in TWikiPreferences |
957d66 22
958@
959
960
9611.12
962log
963@none
964@
965text
966@d1 1
967a1 1
968%META:TOPICINFO{author="PeterThoeny" date="1059253080" format="1.0" version="1.12"}%
969d41 1
970d69 1
971a69 1
972See TWiki:Plugins/SkinPackagingHowTo
973@
974
975
9761.11
977log
978@none
979@
980text
981@d1 1
982a1 1
983%META:TOPICINFO{author="PeterThoeny" date="1042010089" format="1.0" version="1.11"}%
984d54 3
985a56 3
986 <option value="%MAINWEB%.TWikiUsers">Employee index</option>
987 <option value="%MAINWEB%.WebHome">%MAINWEB% web</option>
988 <option value="%TWIKIWEB%.WebHome">%TWIKIWEB% web</option>
989@
990
991
9921.10
993log
994@none
995@
996text
997@d1 1
998a1 1
999%META:TOPICINFO{author="PeterThoeny" date="1041742761" format="1.0" version="1.10"}%
1000d30 2
1001a31 2
1002| =%<nop>WEB%= | The name of the current web. __Note:__ It is recommended to URL-encode the variable in form actions with =%<nop>URLENCODE{"%<nop>WEB%"}%= for proper handling in an internationalized environment |
1003| =%<nop>TOPIC%= | The name of the current topic. __Note:__ It is recommended to URL-encode the variable in form actions with =%<nop>URLENCODE{"%<nop>TOPIC%"}%= for proper handling in an internationalized environment |
1004d49 1
1005a49 1
1006<form name="sample" action="%SCRIPTURL%/view%SCRIPTSUFFIX%/%URLENCODE{"%WEB%/%TOPIC%"}%">
1007@
1008
1009
10101.9
1011log
1012@none
1013@
1014text
1015@d1 1
1016a1 1
1017%META:TOPICINFO{author="PeterThoeny" date="1041669480" format="1.0" version="1.9"}%
1018d30 2
1019a31 4
1020| =%<nop>WEB%= | The name of the current web |
1021| =%<nop>WEBURLENCODED%= | The name of the current web, URL encoded (for form action) |
1022| =%<nop>TOPIC%= | The name of the current topic |
1023| =%<nop>TOPICURLENCODED%= | The name of the current topic, URL encoded (for form action) |
1024d49 1
1025a49 1
1026<form name="sample" action="%SCRIPTURL%/view%SCRIPTSUFFIX%/%WEBURLENCODED%/%TOPICURLENCODED%">
1027d83 1
1028a83 1
1029-- PeterThoeny - 03 Jan 2003
1030@
1031
1032
10331.8
1034log
1035@none
1036@
1037text
1038@d1 1
1039a1 1
1040%META:TOPICINFO{author="MikeMannix" date="1000619467" format="1.0" version="1.8"}%
1041d16 56
1042d85 1
1043a85 1
1044-- PeterThoeny - 14 Jul 2001 <br>
1045@
1046
1047
10481.7
1049log
1050@none
1051@
1052text
1053@d1 1
1054a1 1
1055%META:TOPICINFO{author="PeterThoeny" date="1000457002" format="1.0" version="1.7"}%
1056d6 1
1057a6 1
1058_Overlay regular templates with alternate header/footer layouts_
1059@
1060
1061
10621.6
1063log
1064@none
1065@
1066text
1067@d1 1
1068a1 1
1069%META:TOPICINFO{author="MikeMannix" date="1000080465" format="1.0" version="1.6"}%
1070d10 1
1071a10 1
1072Skins are customized [[TWikiDocumentation#TWiki_Template_System][TWiki Templates]] files. You can use skins to change the look of a %WIKITOOLNAME% topic, for example, the layout of the header and footer. Rendered text between header and footer does __not__ change. You can also use skins to define an alternate view, like a view optimized for printing.
1073d12 1
1074a12 1
1075--++ Defining Skins
1076@
1077
1078
10791.5
1080log
1081@none
1082@
1083text
1084@d1 3
1085a3 1
1086%META:TOPICINFO{author="MikeMannix" date="999857258" format="1.0" version="1.5"}%
1087d6 1
1088a6 1
1089Skins are customized [[TWikiTemplates][TWikiTemplate]] files. You can use skins to change the look of a %WIKITOOLNAME% topic, for example the layout of the header and footer. Note that the renderd text between header and footer does __not__ change. You can also use skins to define an alternate view, ex: a view optimized for printing.
1090d8 9
1091a16 1
1092Skin files are located in the ==twiki/template== directory and are name with this syntax: ==&lt;scriptname&gt;.&lt;skin&gt;.tmpl==. For example, the ==print== skin for the ==view== template is ==view<font color="red">.print</font>.tmpl== (red color added for clarification).
1093d19 2
1094a20 1
1095	* Define the SKIN preference variable in TWiki.TWikiPreferences, one of the WebPreferences, or a user preference. Ex:
1096d22 1
1097d27 1
1098a27 1
1099The ==?skin=name== URL parameter overrides the SKIN preference value.
1100@
1101
1102
11031.4
1104log
1105@none
1106@
1107text
1108@d1 2
1109a2 2
1110%META:TOPICINFO{author="MikeMannix" date="999209301" format="1.0" version="1.4"}%
1111---## TWiki Skins
1112@
1113
1114
11151.3
1116log
1117@none
1118@
1119text
1120@d1 1
1121a1 1
1122%META:TOPICINFO{author="PeterThoeny" date="995179879" format="1.0beta2" version="1.3"}%
1123d4 1
1124a4 1
1125Skins are customized [[TWikiTemplates][TWikiTemplate]] files. You can use skins to change the look of a %WIKITOOLNAME% topic, for example the layout of the header and footer. Note that the renderd text between header and footer does __not__ change. You can use skins also to define an alternate view, i.e. a view optimized for printing.
1126d6 1
1127a6 1
1128A skin file is located in the ==twiki/template== directory and has a name like ==&lt;scriptname&gt;.&lt;skin&gt;.tmpl==. For example, the ==print== skin for the ==view== template is ==view<font color="red">.print</font>.tmpl== (red color added for clarification).
1129d9 3
1130a11 3
1131	* Define the SKIN preference variable in TWiki.TWikiPreferences, one of the WebPreferences, or a user preference. I.e.
1132		* =Set SKIN = wikiwiki=
1133	* Add =?skin=name= to the URL, i.e. for this topic:
1134@
1135
1136
11371.2
1138log
1139@none
1140@
1141text
1142@d1 1
1143d4 1
1144a4 1
1145Skins are customized template files. You can use skins to change the look of a %WIKITOOLNAME% topic, for example the layout of the header and footer. Note that the renderd text between header and footer does __not__ change. You can use skins also to define an alternate view, i.e. a view optimized for printing.
1146d6 1
1147a6 1
1148A skin file is located in the ==twiki/template== directory and has a name like ==&lt;scriptname&gt;.&lt;skin&gt;.tmpl== or ==&lt;scriptname&gt;.&lt;topicname&gt;.&lt;skin&gt;.tmpl==. For example, the ==print== skin for the ==view== template is ==view<font color="red">.print</font>.tmpl== (red color added for clarification).
1149d10 1
1150a10 1
1151		* <nop>Set SKIN = wikiwiki <br> *Note:* Who has time to create the classic =wikiwiki= skin?
1152d17 1
1153a17 1
1154-- PeterThoeny - 16 Mar 2001 <br>
1155@
1156
1157
11581.1
1159log
1160@none
1161@
1162text
1163@d1 2
1164d5 1
1165a5 1
1166A skin file is located in the =twiki/template= directory and has a name like =&lt;scriptname&gt;.&lt;skin&gt;.tmpl= or =&lt;scriptname&gt;.&lt;topicname&gt;.&lt;skin&gt;.tmpl=. For example, the =print= skin for the =view= template is =view<font color="red">.print</font>.tmpl= (red color added for clarification).
1167d14 1
1168a14 1
1169The =?skin=name= URL parameter overrides the SKIN preference value.
1170d16 1
1171a16 1
1172-- Main.PeterThoeny - 20 Jan 2001 <br>
1173@
1174