%META:TOPICINFO{author="PeterThoeny" date="1128738157" format="1.0" version="1.4"}%
---+!! TWiki Admin Cook Book

This page has many tips and tricks, particularly useful when you're installing TWiki for the first time. This guide is most useful *%RED%before%ENDCOLOR%* or immediately following a TWiki installation! 

%TOC%

__See also:__

	* InstantEnhancements - how to easily enhance a default TWiki using only your browser. Each item is designed to be quickly implemented.
	* TWiki:Codev.UsabilityIdeas - has additional useful ideas. 

---
---++ During Installation

---+++ Create custom skin

In an Intranet environment it helps "sell" TWiki if it looks like the Intranet. Consider creating a custom [[TWikiSkins][TWiki skin]].

---+++ Rename Main web to User web

You can rename the =Main= web to =User=. It will make WikiWord links to usernames more meaningful (<nop>User.UserName instead of <nop>Main.UserName); but does not bring much gain for other types of topics like (<nop>User.EngineeringGroup or <nop>User.TokyoOffice). Just rename =data/Main= to =data/User=, and change =$mainWebname= variable in =lib/TWiki.cfg= file. Signatures in all existing topics need to be fixed as well.

See also TWiki:Codev.RenameMainWebToHome, TWiki:Codev.RenameTheMainWeb, TWiki:Codev.SeparateHowtoWeb for arguments pro and con.

---+++ Help with remembering passwords

Users keep Forgetting Passwords (see TWiki:Codev.ForgettingPasswords ). When demonstrating TWiki to new users and/or helping them with TWikiRegistration, do not forget to show the user how to use the "remember my password" feature in their browser.

A quick way to check the guest password is to view the =.htaccess= file. 

=<nop>AuthName 'TWiki <nop>UserName (i.e. <nop>TWikiGuest/guest)'=

%H% __Hint:__ In a behind firewall setting it is better to configure TWiki to use an existing directory (NIS, LDAP, Active Directory) so that users do not need to remember multiple passwords.

---+++ How to deal with robots that try to index a public TWiki site

__Dealing with Robots__

Robots crawling and prowling a public TWiki site can have a significant impact on the CPU load. You can see what is happening on your site by reading the file =twiki/data/log&lt;YYYYMM&gt;.txt=. You might see hundreds of hits per hour by robots. When rdiff or search are used by the robots, a site may consume 70 or 80 percent of the system resource.

__The robot problem is caused by several issues which can be dealt with separately__

	1. Your TWiki exposes many links to robots, and simply answering them takes a lot of computer time. Even if you do want to have all that available, you want it to go as fast as possible.
	2. Many of the things robots try to grab are inappropriate for them.  We don't want them searching or running recursive differences. 
	3. The default TWiki install includes lots of files & links that many people may not want.  So you can cut down on traffic by blocking those links.

__Subdividing the "approaches" to these problems, here we go!__

	1. Robots try to grab stuff that they should not have.
		A. Fix the WebLeftBar and the WebBottomBar so that they DO NOT show links to casual visitors.  If a robot does not find a "search" button, then it cannot waste your CPU by trying to use it.
		A. In the bottom bar, have a new regime that shows only a "Login" button.  Only after a person logs in (TWiki:Plugins.SessionPlugin or ordinary htauthentication is OK), does one see links to Edit and such.  You can use the SpreadSheetPlugin to make a conditional display.  It does not show the "good stuff" to !TWikiGuest.
		A. Hide WebChanges. Hide WebTopicList. Hide WebIndex.  My WebLeftBar is reconfigured to expose less stuff. Especially pages that rely on searches.  Go through your webs and try to get rid of miscellaneous links to WebTopicList or WebIndex.  Create one topic, and one topic only, that has that information.  That new topic, called !WebGuide, is liberally linked and available from the left bar.  However, the difference is that the !WebGuide topic does not have point-and-click links.  Instead, it just gives users a line they can type into the web browser URL so they can conduct the search they want.
		A. Use the TWiki:Plugins.VarCachePlugin to cache topics that consume CPU time, such as WebTopicList and WebIndex
		A. If you are a site administrator, there is a file called "robots.txt" that sits at the top level of the web server's public space.  Robots are supposed to read that file and respect its prohibitions.  Some robots ignore it.  Add a substantial list of things to your robots.txt file.  Ban all robotic uses of any TWiki feature except view. No edit, rdiff, search, or any of that other stuff.

---+++ Sorting Recent Changes

How to allow the "Recent Changes" table to be sortable by columns other than modified date. 

Rather than changing the search template, you can change WebChanges to use FormattedSearch instead. The results are now formatted as a single TWiki table, which allows sorting by any column. Of course, this only applies to recent changes, not generic searches.

Here are the contents of the topic:

<verbatim>
%STARTINCLUDE%
<div id="searchtable">
%N% Click on a column heading to sort the results by topic name or modifier name (instead of modified date). Click the heading again to reverse the sort.
%TABLE{ sort="on" tableborder="0" cellpadding="5" cellspacing="0" headerbg="white" headercolor="black" databg="white" headerrows="1" footerrows="0" }%
%SEARCH{".*" web="%INCLUDINGWEB%" regex="on" nosearch="on" order="modified" reverse="on" limit="%URLPARAM{"limit" default="50"}%" header ="| *Topic* | *Changed<br>(now %DISPLAYTIME{"$hou:$min"}%)* | *Changed by* |" format="|<a href=$topic title=$topic>$topic(40, ...)</a><br>$summary(80) |$date - $percntCALC{$IF($EXACT(1.1, $rev), <b>NEW</b>, r$rev [[%SCRIPTURL%/rdiff%SCRIPTSUFFIX%/$web/$topic (diff)]])}$nop% |$wikiusername |" }%</div>

	* See [[%SCRIPTURL%/view%SCRIPTSUFFIX%/%INCLUDINGWEB%/%INCLUDINGTOPIC%?limit=100][100]], [[%SCRIPTURL%/view%SCRIPTSUFFIX%/%INCLUDINGWEB%/%INCLUDINGTOPIC%?limit=200][200]], [[%SCRIPTURL%/view%SCRIPTSUFFIX%/%INCLUDINGWEB%/%INCLUDINGTOPIC%?limit=400][400]], [[%SCRIPTURL%/view%SCRIPTSUFFIX%/%INCLUDINGWEB%/%INCLUDINGTOPIC%?limit=800][800]] most recent changes

	* See [[%SCRIPTURL%/view%SCRIPTSUFFIX%/%INCLUDINGWEB%/%INCLUDINGTOPIC%?limit=all][all]] changes

<style>
#searchtable th {
  font-size: 125%;
  border-top: 3px solid #8caae6;
  border-bottom: 3px solid #8caae6;
}
#searchtable {
  padding-bottom: 1em;
  border-bottom: 3px solid #8caae6;
}
#searchtable th A:link, th A:visited, th A:active { text-decoration: none; }
#searchtable th A:hover { text-decoration: underline; }
</style>
%STOPINCLUDE%
</verbatim>

Here are some details:
	* CSS markup is used to make the results look somewhat similar to the original search results.
	* The topic name is truncated to eliminate the "page dropping down in IE" issue in TWiki:Plugins.BlueSkin. The full name is shown as a tooltip on mouse hover. This is identical to the Outlook behaviour for long subject lines.
	* The topic summary is not in a separate row anymore, since that messes up the sorting. 
	* The revision summary is presented as =DATE - TIME - REV (diff)=, to keep the sorting consistent.

----
---++ Before First Presentation

Tips about first presentation -- ATasteOfTWiki is a handy presentation you can give to your users. Read also TWiki:Main.TWikiCourseOutlineExample and TWiki:Codev.HowToGetInternalBuyInForTWiki. The TWiki:Codev.TWikiPresentation05Aug2004 talk given by TWiki:Main.PeterThoeny during !LinuxWorld gives some background on TWiki collaboration.

How to build participation: read WikiOrg:TipsForSiteOperators - advice directly from Ward Cunningham, author of Wiki concept and first Wiki.

Consider installing [[#CommentPlugin]] and [[#SlideShowPlugin]] before your first demo.

---+++ Simplify menu in page templates

*How to get nice pages with simpler menu options for beginners*

A *Skin* is TWiki's way to present different system-generated formats (like header/footer/sidebar menu) *and exactly the same* information from the page body (see TWikiSkins). The "Classic" TWiki skin is oriented towards advanced power users. _Newbies_ may feel overwhelmed by the number of options. Many simpler custom skins are in development at TWiki:Plugins.WebHome. Consider using a simpler custom skin to make a better "first impression": _TWiki is simple to use._ 

There is currently a discussion at TWiki:Codev.SimplerDefaultTemplates about simpler default template for TWiki:Codev.SimplerTWikiDistribution.

---+++ Customize tutorial for beginners 

Select simpler skin and customize beginner's help topics accordingly. 

---
---++ Ongoing admin tasks

---+++ Admin Tools

AdminTools has most of the tools you need to administer a TWiki site - on one page. You can link it from SiteMap.

---------------------
---++ Best of Plugins

With more than 170 TWiki plugins (and counting), there are a lot to choose from. Plugins are mainly contributed by TWiki users who are software developers. Plugins are a relatively new TWiki addition, so there are fewer established standards than for the core TWiki code.  This means that not all plugins are equal in ease of installation, operation, or compatibility with each other. Here are selected plugins that are reliable, easy-to-use and offer basic enhanced functionality.

#CommentPlugin
---+++ <nop>CommentPlugin !! -- TWiki:Plugins.CommentPlugin

User-friendly alternative of ==Edit==, without losing Wiki spirit. Comments can be entered in a conventional Web form style with a text box and a submit button.  This is all displayed on a TWiki page without having to use TWiki's ==Edit==. Text added appears exactly as if edited normally, and topic can be edited also using the full TWiki ==Edit==. This is useful to encourage participation among your users who are not yet comfortable with TWiki capabilities.

#SlideShowPlugin
---+++ <nop>SlideShowPlugin !! -- TWiki:Plugins.SlideShowPlugin

This Plugin allows you to convert topics with headings into web based presentations. This is a useful alternative to <nop>PowerPoint, especially if you need to link to related content.

---+++ <nop>SpreadSheetPlugin !! -- TWiki:Plugins.SpreadSheetPlugin

This Plugin allows you to add spreadsheet calculation like ="$SUM( $ABOVE() )"= to tables located in TWiki topics. 

---+++ <nop>TablePlugin !! -- TWiki:Plugins.TablePlugin

A must-have, this Plugin allows you to control attributes of tables and sorting of table columns.

---+++ <nop>TopicVarsPlugin !! -- TWiki:Plugins.TopicVarsPlugin

This lets you create variables, like a graphics icon library, in any topic - instead of only in WebPreferences - and refer to them from other topics within the same web.

---
---++ TWiki-based Applications

TWiki can be used as a platform to build web applications, also called TWiki:Codev.TWikiApplications.

---+++ Sample applications
	* Simple workflow application: TWiki:Sandbox.ItemToDo 
	* Simple inventory system with filtering capabilities: TWiki:Main.TWikiInstallation
	* Simple change request application: TWiki:Sandbox.ChangeRequest
	* Extended SEARCH capabilities: TWiki:Codev.SearchWithAnd

---+++ Adding extra input boxes to your edit screen that write to the text

It's often the case that when you are building TWiki:Codev.TWikiApplications, there are frequently used constructs that you want to add to the text - for example, searches, or actions, or other complex tags.

It's really not hard to add support for this to your edit skin.

The following example adds an action entry box to the edit template. It can be done by adding the following to the edit.pattern.tmpl, though it could of course be included from another topic or via a =%<nop>TMPL:DEF= definition.

<verbatim>
<h3>Add action</h3>
Who: <input type="text" value="" name="action_who" />
Due: <input type="text" value="" name="action_due" /><br />
<textarea wrap="virtual" rows="3" cols="70" value="" name="action_desc">
</textarea>
<input type="button" value="Add action" onClick="document.main.text.value+='%ACTION{'+' due=\''+document.main.action_due.value+'\''+' who=\''+document.main.action_who.value+'\''+'}% '+document.main.action_desc.value.replace(/\n/g,'<br />')+'\n'" />
want to add extra functionality to skins, to support the adding of formatted text entered 
</verbatim>

and it looks like this:

*Add action*
<form name="example">
Who: <input type="text" value="" name="action_who" />
Due: <input type="text" value="" name="action_due" /><br />
<textarea wrap="virtual" rows="3" cols="70" value="" name="action_desc">
</textarea>
<input type="button" value="Add action" onClick="document.example.text.value+='%ACTION{'+' due=\''+document.example.action_due.value+'\''+' who=\''+document.example.action_who.value+'\''+'}% '+document.example.action_desc.value.replace(/\n/g,'<br />')+'\n'" />

<textarea name="text" rows="5" cols="70">
(any actons you add should appear below here
</textarea>
</form>

---

Please add your favorite TWiki tips/trick to TWiki:%WEB%.%TOPIC% to help the next new TWiki admin. (One BIG area: include pages of implemented basic SEARCHes, like, to generate a straight TOPICS list (alphabetical web topic titles only); also, simple combos of forms + search, like one- and two-category forms to use to classify pages, and then searches to find and display in few useful formats; more in that general area.)

---++ Contributors

TWiki:Main.CrawfordCurrie, TWiki:Main.GrantBow, TWiki:Main.JonReid, TWiki:Main.MikeMannix, TWiki:Main.MikeMaurer, TWiki:Main.PankajPant, TWiki:Main.PaulJohnson, TWiki:Main.PeterMasiar, TWiki:Main.PeterThoeny

