NOTE: This is a
DistributionDocument. Please help maintain high quality documentation: This is a wiki, please
fix the documentation if you find errors or incomplete content. Put questions and suggestions concerning the
documentation of this topic in the
comments section below. Use the
Support web for problems you are having
using TWiki.
Instant TWiki Site Enhancements
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.
Many of these tips are based on setting some special
TWikiVariables.

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.
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.
TWikiVariables are a great resource to customize your site. You need to know the variable name and decide where to put it.
Change Colors of Page Header/Footer
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.
What we are doing
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
{*}. Each web has its own WebPreferences, and you can set them differently for each web.
How to do it
- Pick color code from company or product references, the StandardColors table (recommended for 8-bit client compatibility), or some other color reference.
- Go to WebPreferences in each web, and edit the topic.
- Set your preferred WEBBGCOLOR preferences variable, and save the topic.
-
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).
It's just as easy to refine later on, so you're not locked in, just looking better.
Set Page Background Color
Without getting into the
TWikiTemplates system yet, you can easily edit the
view.tmpl (in the
templates directory). In the HTML at the top, the body tag has the page background hardcoded to white
bgcolor="#ffffff". You can change that color value to new variable. First, define a new preferences variable in the site-level
Main.TWikiPreferences, e.g.
* Set =PAGEBGCOLOR = #d0d0d0, then edit the
view.tmpl template file and change
bgcolor="#ffffff" to
bgcolor="%PAGEBGCOLOR%". 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.)
Titles-Only Topic List - WebTopicList
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.
Without explaining what WEBTOPICLIST is, just try it:
- Go to WebPreferences in each web, and edit the topic.
- In WEBTOPICLIST variable, replace
WebIndex with WebTopicList, and save.
Simple way to create colored text and graphics
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
raw format.
EZ Graphic Icons to Highlight Text
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.
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

.
Creating image variables
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
Main.TWikiPreferences.)
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.
For instance, if we want to write
%DOWN% instead of
%ICON{"arrowbdown"}%, define the new variable like this:
* Set DOWN = %ICON{"arrowbdown"}%
Or if you have a custom image to use, attach this to
Main.TWikiPreferences and write:
* Set DOWN = <img src="%ATTACHURL%/my_image.gif" border="0" alt="DOWN" width="16" height="16" />
Most images in
TWikiDocGraphics are 16 x 16 pixels.
- 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.
Use TOC variable to create table of content
TOC is Table-Of-Content, generated automagically from headers (defined like that:
---++ , see
TWikiShorthand).
For example, you may want to put all your custom variables in
Main.TWikiPreferences right on top of the page, and generate table of contents, like:
- Preferences for easy creating nice pages
- Graphics icons in text
- Colored text
- System Preferences
- Contents of page header and footer
- User interface defaults
- Email
- Plugins
- Notes
Non-admin users wil be interested only in first part, non-system preferences.
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!
Use your favorite text editor for major edits
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.
Windows Example: TextPad 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.
Copy & 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.
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
Alternate Browser: While your main browser might not have the features for TWiki topic editing, another one might.
- 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.
Personal directory of topics you're involved in
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 (
TWikiGuest). 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.
Start Copy
__Here's a list of topics I've been involved in recently:__
---++++ Codev
%SEARCH{ "%TOPIC%" web="Codev" scope="text" nosearch="on" nosummary="on" noheader="on" nototal="on" order="modified" reverse="on" limit="20"}%
---++++ Support
%SEARCH{ "%TOPIC%" web="Support" scope="text" nosearch="on" nosummary="on" noheader="on" nototal="on" order="modified" reverse="on" limit="20"}%
---++++ TWiki
%SEARCH{ "%TOPIC%" web="TWiki" scope="text" nosearch="on" nosummary="on" noheader="on" nototal="on" order="modified" reverse="on" limit="10"}%
End Copy
The SEARCH variable has many more formatting options, see
TWikiVariables.
Recently changed pages
Here are the last 15 changed pages, formatted into a neat table.
<table>
%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" }%
</table>
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
Edit.
- Example:
Set ALLOWTOPICCHANGE = Main.UserName, Main.GroupName
-
To hide the setting: Use HTML comment tags - put <!-- on the line _above the setting, and --> on the line below.
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:
-
Set WEBLOGONAME = filename.gif
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)
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.,
-
Set WEBLOGOIMG = %PUBURLPATH%/Main/WebPreferences/mylogo.gif
With a simple one or two-line default topic form available for every topic - in
Edit mode, click the
[Add] button, and select the form if it isn't already enabled. Then, click the title to get to the actual form,
[Edit], 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.
(add the corresponding search per category - copy a default and change)
You're no doubt familiar or better with HTML, JS, and "webmastering". Without getting into the
TWikiTemplates system yet, you can easily edit the
view.pattern.tmpl (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
<head> area, and you can drop in reliable JavaScripts - a pop-up window script, for example - or tag it as an external script.
-
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

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.
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.)
NOTE: Feel free to add your own tips to
TWiki:TWiki.InstantEnhancements as quick notes at the end of the list, following the existing format!
Related Topics: AdminDocumentationCategory
--
Contributors: TWiki:Main.GrantBow,
TWiki:Main.LynnwoodBrown,
TWiki:Main.MikeMannix,
TWiki:Main.PeterMasiar,
TWiki:Main.PeterThoeny,
TWiki:Main.MattWilkie,
TWiki:Main.AmandaSmith
Please see my question on
TWiki:Support/FormattedSearchTableWidth If you are going to recommend a search method, you might as well recommend a modern
FormattedSearch! As the support request describes I'm still working on the last detail or two to provide an identically capable output, hence the note about diffs.
--
GrantBow - 17 Jan 2003
Thank you for fixes. I am not an expert in
FormattedSearch, so I need help with that. Fell free to add what you feel is appropriate. I'll try to fix what I can, but not more...
--
PeterMasiar - 17 Jan 2003
In the above Support request the code is spelled out for my search. 10 minutes with
TWikiVariables looking at the entry for
%SEARCH{}% and
FormattedSearch and you'll fully understand what's going on. On my own personal page I stuck several searches (one for each TWiki web) into a 50% wide table which I find amazingly useful.
--
GrantBow - 17 Jan 2003
My goal now on my TWiki is to reduce the maintenance load on the admin person to as low a level as possible. It would be great to have a page named something like
TWikiMaintenanceImplicationsOfPerlAndTWikiML . That is I would like to also have a page that pulls perl and twiki out a bit more visibly for people like me - who don't fit the the
AdminSkillsAssumptions definitions - but have made really a pretty good job of it using common sense, basic coding skills and brought in expertise when needed.
Such a page might have a table something like this for example:
|
|
| Perl data structure/TWiki ML/feature |
Implications for maintenance |
Recommended don't do's |
Issues |
| Internal links |
Proper use will ensure that links are not broken if topic moved |
Do not use a full URl for an interna link |
None? |
| TWiki Groups |
Enables global change of TWiki member edit privileges via change on one page only. |
Don't use individual TWiki User names for access control on pages - always use a group, even if there is only one member |
None? |
Perl variable %TOC |
Automated updating of table of contents |
Don't used named anchors ala HTML TOC conventions |
There is some discussion on this to make this a plugin rather than an embedded feature which I am not up on - so the efficacy of this variable is perhaps under a cloud. |
| TWiki forms and formatted searches |
Careful use will enable dynamic tables to be created of topics meeting specified criteria without need for admin wikigardening to support users better access topics. |
None? |
Can be difficult for newbies. Find a good tutorial somewhere and adapt it for your own use |
|
|
|
etc, etc.
I wonder what other admins might think of this idea. If it is a good idea I could see it as great page for tips and tricks that admins have found to help make an admin's life a lot easier (and leave them time to go off and learn perl in depth maybe

).
--
SueLocke - 10 Jan 2005
I've implemented this kind of function now on my own TWiki site. If anyone is interested - drop me an email.
--
SueLocke - 12 Jan 2005
I added a section on customizing the
WebLeftBar. It took me ages to figure out how because it wasn't mentioned in the documentation. This seemed like a good place for it.
--
AmandaSmith - 31 Jan 2006
Thanks Amanda, just in time for TWiki 4.0 release.
--
PeterThoeny - 31 Jan 2006
Has 4.2 changed anything that would impact the first example given under Ready to use Search? Using this example on my own TWiki (4.2) seems to omit some hits. Using the same example here on TWiki.org seems to include all the hits I would expect. I first suspected that the missing hits on my own TWiki were ones edited after a recent move to a new server and upgrade to 4.2. But that turns out to not be the case. The returned hits are a mix of "old" and "new" topics. But many topics I have recently created and edited are not returned. (I know, Peter, I'll ask in Support as well. but here I was focused on this document.)
Update: I've found that actually, the Search itself seems to not be returning all the right hits on my TWiki. Even the
LeftBar ? My Activities link doesn't return all the hits. That link is
* [[%SCRIPTURL{search}%/%BASEWEB%/?search=DavidWolfe;order=modified;limit=50;reverse=on][My %BASEWEB% activities]]
When I click the link, the search results page is definately not showing all the topics I've recently created or edited. The odd thing is that it does show some of them. There should be no username issue because my TWiki requires login for all scripts and I'm always logged in as the same user. If I visit a topic I've recently created I can see my username at the top of the topic. Yet that topic does not show up as a hit on a search for my username.
--
DavidWolfe - 12 May 2008
The section on changing the background color for a page or a web may be old. My 4.1.2 version of TWiki doesn't have any HTML in the view.tmpl file, nor is the bgcolor set to a default. Where is this stored now? I'll post in Support as well, but the documentation really needs a top-to-bottom review for accuracy and clarity. I'd help but there's a lot I don't know.
--
CassandraTargett - 25 Jul 2008
Thanks Cassandra for offering to help out. Please feel free to change the content directly on this page. We will take care of synchronizing it with the next TWiki release.
--
PeterThoeny - 26 Jul 2008