Revert spam
[openafs-wiki.git] / TWiki / InstantEnhancements.mdwn
1 # <a name="Instant TWiki Site Enhancements"></a><a name=" Instant TWiki Site Enhancements"></a> Instant TWiki Site Enhancements
2
3 These quick enhancements are aimed at improving and customising your TWiki. New TWiki site administrators are especially encouraged to review this document for ideas before deploying a new [[TWikiSite]]. The metaphor of building a house is useful. The listed enhancements are some of the details possible when moving into a new office or home. These small changes can make a **big** differences for user satisfaction at your site. All modifications can be done through your Web browser, and they don't take more then in a couple of minutes. No system administration expertise is required. Some of these enhancements are also mentioned in the reference manual and other topics.
4
5 Many of these tips are based on setting some special [[TWikiVariables]].
6
7 %S% We recommend implementing at least **_some_** of these enhancements **_right after installation_** to get a taste for what is possible. Some of these tips and enhancements _should_ be implemented before or during initial roll-out.
8
9 This may spark your imagination to **really** customize your site so that it's optimal for **your** users. Slightly more advanced customization tips are listed in TWiki:TWiki.TWikiAdminCookBook.
10
11 <div>
12   <ul>
13     <li><a href="#Tips using TWiki Variables"> Tips using TWiki Variables</a><ul>
14         <li><a href="#Change Colors of Page Header/Foo"> Change Colors of Page Header/Footer</a></li>
15         <li><a href="#Set Page Background Color"> Set Page Background Color </a></li>
16         <li><a href="#Titles-Only Topic List - _WebTo"> Titles-Only Topic List - WebTopicList</a></li>
17         <li><a href="#Simple way to create %RED% color"> Simple way to create %RED% colored text %ENDCOLOR% and graphics</a></li>
18         <li><a href="#EZ Graphic Icons to Highlight Te"> EZ Graphic Icons to Highlight Text</a></li>
19         <li><a href="#Use TOC variable to create table"> Use TOC variable to create table of content</a></li>
20       </ul>
21     </li>
22     <li><a href="#Personal Productivity - Tools an"> Personal Productivity - Tools and Tips for Working Faster</a><ul>
23         <li><a href="#Use your favorite text editor fo"> Use your favorite text editor for major edits</a></li>
24       </ul>
25     </li>
26     <li><a href="#Ready to use SEARCH"> Ready to use SEARCH </a><ul>
27         <li><a href="#Personal directory of topics you"> Personal directory of topics you're involved in</a></li>
28         <li><a href="#Recently changed pages"> Recently changed pages </a></li>
29       </ul>
30     </li>
31     <li><a href="#Hidden Edit Lock for Individual"> Hidden Edit Lock for Individual Topics</a></li>
32     <li><a href="#Change the Default Logo"> Change the Default Logo</a></li>
33     <li><a href="#Customize Topic Classification F"> Customize Topic Classification Forms</a></li>
34     <li><a href="#Add Your Favorite _JavaScript Fe"> Add Your Favorite JavaScript Features</a></li>
35     <li><a href="#Customize The Left Navigation Ba"> Customize The Left Navigation Bar</a></li>
36   </ul>
37 </div>
38
39 ----
40
41 ## <a name="Tips using TWiki Variables"></a> Tips using TWiki Variables
42
43 [[TWikiVariables]] are a great resource to customize your site. You need to know the variable name and decide where to put it.
44
45 ### <a name="Change Colors of Page Header/Foo"></a> Change Colors of Page Header/Footer
46
47 Incredibly obvious, maybe, but some TWiki site admins don't get around to changing the default web colors right off, whether they like them or not. Simply changing the defaults will make a huge difference in the overall look.
48
49 **What we are doing**
50
51 We want to set variable WEBBGCOLOR in topic [[WebPreferences]] to one of the [[StandardColors]]. WebPreferences is, as you can guess, a topic which holds all kind of preference setting for each TWiki Web[[{*}|Main/ManagingWebs]]. Each web has its own WebPreferences, and you can set them differently for each web.
52
53 **How to do it**
54
55 1. Pick color code from company or product references, the [[StandardColors]] table (recommended for 8-bit client compatibility), or some other color reference.
56 2. Go to [[WebPreferences]] in each web, and edit the topic.
57 3. Set your preferred WEBBGCOLOR preferences variable, and save the topic.
58 4. %X% Add a new line immediately after the color code. If there is (invisible) space after the color code, the page header might get strange colors (e.g. black).
59
60 It's just as easy to refine later on, so you're not locked in, just looking better.
61
62 ### <a name="Set Page Background Color"></a> Set Page Background Color
63
64 Without getting into the [[TWikiTemplates]] system yet, you can easily edit the <code>**view.tmpl**</code> (in the `templates` directory). In the HTML at the top, the body tag has the page background hardcoded to white <code>**bgcolor="#ffffff"**</code>. You can change that color value to new variable. First, define a new preferences variable in the site-level [[Main.TWikiPreferences|Main/TWikiPreferences]], e.g. `* Set =PAGEBGCOLOR = #d0d0d0`, then edit the <code>**view.tmpl**</code> template file and change <code>**bgcolor="#ffffff"**</code> to <code>**bgcolor="%PAGEBGCOLOR%"**</code>. If you want, you can set the page background color individually per web, simple add a `* Set =PAGEBGCOLOR = #d0d0d0` bullet to the [[WebPreferences]] to overload the site-level preferences. (Without font color control, you'll have to stick to light colors.)
65
66 ### <a name="Titles-Only Topic List - _WebTop"></a> Titles-Only Topic List - WebTopicList
67
68 [[WebTopicList]] is a **_good first navigation tool for new users,_** a fast-loading linked list (page titles only) of a web's topics is a quick and easy way see what's available. By default, slower, but more powerful [[WebIndex]] is used.
69
70 Without explaining what WEBTOPICLIST is, just try it:
71
72 1. Go to [[WebPreferences]] in each web, and edit the topic.
73 2. In WEBTOPICLIST variable, replace `WebIndex` with `WebTopicList`, and save.
74
75 ### <a name="Simple way to create %RED% color"></a> Simple way to create %RED% colored text %ENDCOLOR% and graphics
76
77 This should be enabled, see the "Miscellaneous Settings" in the [[TWikiPreferences]], . If not, look at TWiki:TWiki/TWikiPreferences. Look for variables RED, BLUE etc (which define HTML tag FONT). To copy/paste the variables defining the colors you need to see the source text, but `Edit` is disabled. Instead, go to `More` and view the topic in <code>**raw**</code> format.
78
79 ### <a name="EZ Graphic Icons to Highlight Te"></a> EZ Graphic Icons to Highlight Text
80
81 Icons can do a lot to enhance scannability of topics. For instance, on **HELP** pages, most people tend to jump around looking for answers rather than reading through - icons help point out the most important bits.
82
83 [[TWikiDocGraphics]] has a whole collection of ready icon images. You can use these images in any topic by referring to their name. For example, TWikiDocGraphics has an image attachment called `days.gif`. To show this image in a topic, write `%ICON{"days"}%` to get <img src="http://www.dementia.org/twiki//view/Main/WebHome/days.gif" width="16" height="16" alt="days" />.
84
85 **Creating image variables**
86
87 You may find it easier to write shorthand graphic notation. You can create your own image variables by defining them in a preference topic (most likely [[%USERSWEB%.TWikiPreferences|USERSWEB/TWikiPreferences]].)
88
89 A variable name may be one letter, like `Y`, or may be longer like `HELP`, `WARN` etc. You can also add your own images, e.g. a `NEW`, or a `ASK` to ask question.
90
91 For instance, if we want to write `%DOWN%` instead of `%ICON{"arrowbdown"}%`, define the new variable like this:
92
93        * Set DOWN = %ICON{"arrowbdown"}%
94
95 Or if you have a custom image to use, attach this to [[Main.TWikiPreferences|Main/TWikiPreferences]] and write:
96
97        * Set DOWN = <img src="%ATTACHURL%/my_image.gif" border="0" alt="DOWN" width="16" height="16" />
98
99 Most images in [[TWikiDocGraphics]] are 16 x 16 pixels.
100
101 - **_Related:_** There are other approaches for creating more extensive TWiki icon libraries. This is a simply and quick way to get started. See [[TWikiDocGraphics]] for more info.
102
103 ### <a name="Use TOC variable to create table"></a> Use TOC variable to create table of content
104
105 TOC is Table-Of-Content, generated automagically from headers (defined like that: <code>**---++**</code> , see [[TWikiShorthand]]).
106
107 For example, you may want to put all your custom variables in [[Main.TWikiPreferences|Main/TWikiPreferences]] right on top of the page, and generate table of contents, like:
108
109 - Preferences for easy creating nice pages
110   - Graphics icons in text
111   - Colored text
112 - System Preferences
113   - Contents of page header and footer
114   - User interface defaults
115   - Email
116   - Plugins
117   - Notes
118
119 Non-admin users wil be interested only in first part, non-system preferences.
120
121 ----
122
123 ## <a name="Personal Productivity - Tools an"></a> Personal Productivity - Tools and Tips for Working Faster
124
125 Although this area applies to all TWiki setups, the initial focus is on TWiki site managers working on a Linux/Apache TWiki site, from a Windows local PC. The assumption being: if you're working with Linux as your desktop, you're probably a programmer or system admin and have these basics handled!
126
127 ### <a name="Use your favorite text editor fo"></a> Use your favorite text editor for major edits
128
129 When you have a fair bit of TWiki formatting work - for example, compiling new info pages from various cut'n'paste sources, editing multiple TWiki topics or contributed material - it's often easier to use a real **[[TextEditor]]** instead of the browser's text edit box. There are several methods for doing this. For Windows, there are several well-recommended text editors.
130
131 **_Windows Example:_** [TextPad](http://textpad.com) is a low-cost, top flight Windows program, with an extended trial period. You can download from a well-stocked library of user-contributed macros, dictionaries, and syntax and clip files. You can also easily create a TWiki clip collection that allows you to format text with TWiki code: select a text string and click for bold, italic, links, bullet lists - just like a regular HTML editor - and also insert blocks of TWiki code, use simple or regex search and replace, more.
132
133 **_Copy &amp; Paste:_** Using the web window this can work very well. System differences may present difficulties with this method but it is simple and reliable in most cases.
134
135 **_Browser Integration:_** Some web browsers can be configured to automatically use an external editor. See your browser documentation for details. Such a configuration and a small tool for Linux is described in an example on TWiki.org. TWiki:Codev/EditDaemonWithGVimIntegration
136
137 **_Alternate Browser:_** While your main browser might not have the features for TWiki topic editing, another one might.
138
139 - An example on the Linux platform is the `w3m` pager/browser for Linux. This is a text based version similar to `lynx` but it includes text editor features and a configurable command set to act like `lynx` if you are more accustomed to it.
140
141 ## <a name="Ready to use SEARCH"></a> Ready to use SEARCH
142
143 ### <a name="Personal directory of topics you"></a> Personal directory of topics you're involved in
144
145 Here's how you can create your own personal directory of topics you've contributed to recently. Copy the text below (between **Start Copy** and **End Copy**) and paste it into your personal page (Main.admin). You can add other webs to search by duplicating one of the web subsections and editing the string \{web ="webname"\} in the search parameters to refer to the specific web you want to search. This script would also work for a group.
146
147 **Start Copy**
148
149     __Here's a list of topics I've been involved in recently:__
150
151     ---++++ Codev
152
153     %SEARCH{ "%TOPIC%" web="Codev" scope="text" nosearch="on" nosummary="on" noheader="on" nototal="on" order="modified" reverse="on" limit="20"}%
154     ---++++ Support
155
156     %SEARCH{ "%TOPIC%" web="Support" scope="text" nosearch="on" nosummary="on" noheader="on" nototal="on" order="modified" reverse="on" limit="20"}%
157
158     ---++++ TWiki
159
160     %SEARCH{ "%TOPIC%" web="TWiki" scope="text" nosearch="on" nosummary="on" noheader="on" nototal="on" order="modified" reverse="on" limit="10"}%
161
162 **End Copy**
163
164 The SEARCH variable has many more formatting options, see [[TWikiVariables]].
165
166 ### <a name="Recently changed pages"></a> Recently changed pages
167
168 Here are the last 15 changed pages, formatted into a neat table.
169
170     <table>
171     %SEARCH{ "\.*" scope="topic" type="regex" nosearch="on" nototal="on" order="modified" reverse="on"  format="<tr><td>  [[$topic][$topic]] </td><td>  $wikiusername  </td><td> $date  </td></tr>" limit="15" }%
172     </table>
173
174 ----
175
176 ## <a name="Hidden Edit Lock for Individual"></a><a name="Hidden Edit Lock for Individual "></a> Hidden Edit Lock for Individual Topics
177
178 When you're creating main gateway pages, you may want to temporarily (or permanently) restrict editing to yourself or a limited group of people. You can do this with a Preference setting that includes one or more users and groups. Only auhorized users will be able to use <code>**Edit**</code>.
179
180 - **_Example:_** <code>**Set ALLOWTOPICCHANGE = %USERSWEB%.UserName, %USERSWEB%.GroupName**</code>
181 - %T% **To hide the setting:** Use HTML comment tags - put <code>**&lt;!--**</code> on the line \_above the setting, and <code>**--&gt;**</code> on the line below.
182
183 ----
184
185 ## <a name="Change the Default Logo"></a> Change the Default Logo
186
187 If you want to change the logo per TWiki web, simply attach a new logo.gif to the web's WebPreferences, and change the logo's filename by overriding the name using WEBLOGONAME in WebPreferences:
188
189 - `Set WEBLOGONAME = filename.gif`
190
191 Other cusomtisations are possible using `WEBLOGOIMG`, `WEBLOGOURL`, and `WEBLOGOALT` (they mirror the `WIKILOGO*` TWiki variables, but are applied to each web, rather than to the %WIKITOOLNAME%-based references)
192
193 If you'd like to have the same customised logo for all the webs, make these changes in [[TWikiPreferences]] instead of each web's WebPreferences, e.g.,
194
195 - `Set WEBLOGOIMG = %PUBURLPATH%/%USERSWEB%/WebPreferences/mylogo.gif`
196
197 ----
198
199 ## <a name="Customize Topic Classification F"></a> Customize Topic Classification Forms
200
201 With a simple one or two-line default topic form available for every topic - in **Edit** mode, click the <code>**[Add]**</code> button, and select the form if it isn't already enabled. Then, click the title to get to the actual form, <code>**[Edit]**</code>, and carefully change values, probably basic page classifications. You'll get some increased value, and hands-on experience with [[TWikiForms]], without having to read up about them first. %X% **_(add the corresponding search per category - copy a default and change)_**
202
203 ----
204
205 ## <a name="Add Your Favorite _JavaScript Fe"></a> Add Your Favorite JavaScript Features
206
207 You're no doubt familiar or better with HTML, JS, and "webmastering". Without getting into the [[TWikiTemplates]] system yet, you can easily edit the <code>**view.pattern.tmpl**</code> (if you are using default pattern skin) (in the `templates` directory) for some dramatic effects. The top of the template is mostly regular HTML with some variables. Open up some space in the <code>**&lt;head&gt;**</code> area, and you can drop in reliable JavaScripts - a pop-up window script, for example - or tag it as an external script.
208
209 - %T% Obviously, you can do the same - place a link to an external stylesheet as well. If you set values for standard HTML tags, you can control a good deal of the type size, style and color with out adding CSS tags. **_example_**
210
211 %X% Depending on what you load up, you may change the overall cross-browser compatibility - however be careful that your site does not look beat up in various other browsers. The scripts you choose will determine compatibility.
212
213 ----
214
215 ## <a name="Customize The Left Navigation Ba"></a> Customize The Left Navigation Bar
216
217 Customize the contents of the [[WebLeftBar]] for each web to include important topics for that web, or to link to an important topic for the overall site. Each web has its own [[WebLeftBar]] page. (This is specific to the [[PatternSkin]].)
218
219 ----
220
221 %T% **_NOTE:_** Feel free to add your own tips to TWiki:%WEB%.%TOPIC% as quick notes at the end of the list, following the existing format!
222
223 **_Related Topics:_** [[AdminDocumentationCategory]]
224
225 -- **_Contributors:_** TWiki:Main.GrantBow, TWiki:Main.LynnwoodBrown, TWiki:Main.MikeMannix, TWiki:Main.PeterMasiar, TWiki:Main.PeterThoeny, TWiki:Main.MattWilkie, TWiki:Main.AmandaSmith