This page (topic) comes from a .leo file which provides additional documentation for TWiki. By cutting and pasting it to a working TWiki, you can see the actual values for the variables.
I don't guarantee that my comments are correct on this page, nor do I know that this is exactly the amount of material or the approach I want to use to present it to a TWiki newbie. It is being used for two purposes at this point in time:
- collecting the facts about these variables -- if you can correct any errors please do
- serving as an example in my sample .leo file of TWiki to demonstrate one way that extensive overly verbose comments can be included in a .leo file with minimal impact on developers who don't need or want this level of verbosity
ToDos:
- Since the primary audience for this material will be on a public twiki (WikiLearn), all the examples on this page that have "hard" references to my home TWiki should be changed to links or "hard" references to twiki.org or WikiLearn. (Can I find out what is in the httpd.conf file for Apache on SourceForge?)
- Fix errors, rewrite (but leave the intended audience as newbies to twiki), consider creating a summary for experienced developers of twiki.
Here are two sample TWiki URLs for use as examples on this page -- the first is a page on twiki.org, the second is a page on a twiki on my home LAN:
These variables can be accessed from topics (see details in
TWikiDocumentation.html):
%TOPIC% (
TWikiVariablesForTWikiNewbies) -- Every "webpage" of TWiki is known as a "topic" -- this is the name of the current topic. It is automatically determined by TWiki. In the examples above, the topic is "TWikiVariables".
%WEB% (Wikilearn) -- TWiki is organized in directories of topics -- the directories are known as webs -- this is the name of the current web. It is automatically determined by TWiki. In the first example, the web is "Sandbox", in the second example the web is "Test".
%WIKIHOMEURL% (/cgi-bin/view/Main/WebHome) -- This is the URL for twiki.org -- the "home" page of TWiki development. It must be manually set in TWiki.cfg when the TWiki is installed.
%defaultUrlHost% is not a TWiki variable that can be accessed in a twiki topic. It is set in TWiki.cfg, and is the base URL for this installation of twiki. In the first example above it is
http://twiki.org
, in the second example it is
http://192.168.0.8
. (IMHO, it should be renamed to hostURL.)
Some of the variables in this section must be set to correlate with settings of the web server and the %defaultUrlHost%. The next six lines are from the httpd.conf file for the Apache server which serves my home TWiki.
# Another trial setup
#(with %<nop>SCRIPTURLPATH% set to "/w")
ScriptAlias /w/ "/home/httpd/twiki/bin/"
ScriptAlias /v/ "/home/httpd/twiki/bin/view/"
# (and %<nop>PUBURLPATH set to "/pub")
Alias / "/home/httpd/twiki/"
%SCRIPTURLPATH% (/cgi-bin) -- must be set (manually) to a value so that this path will lead to the /bin directory for this installation of TWiki. The bin directory for my home LAN is at /home/httpd/twiki/bin/, an alias for this path is /w/ (from the
ScriptAlias line above), so the %SCRIPTURLPATH% for this TWiki must be set to "/w". (Note the absence of a final slash in "/w" -- I can't easily or immediately explain why the difference, but it seems to be required.) See the next item.
<aside>
The next
ScriptAlias (/v/) gives a specific path to the view script, which allows me to enter URLs of the form
http://192.168.0.8/v/Sandbox/TWikiVariables
instead of
http://192.168.0.8/w/view/Sandbox/TWikiVariables
, which just saves me a few keystrokes when typing URLs into my browser's address bar.
I've tried various experiments trying to get this down to URLs of the form
http://192.168.0.8/Sandbox/TWikiVariables
, but when I make this work, I can't find a combination of variable settings that allow the automatically created URLs for the other scripts (edit, preview, etc.) to work properly. AFAICT, I would have to make changes to the TWiki Perl code, which I am not ready to do.
There could be various other approaches useful for this reason and others -- on a TWiki subject to a lot of use, it might be helpful to create and save all the views and serve them as static pages, and only serve the edit, preview, and similar pages as dynamic "TWiki" pages. (Of course, after an edit, preview, save cycle, code would have to replace the existing static view with the new static view.
</aside>
%SCRIPTURL% (
https://twiki.org/cgi-bin) -- this is the base TWiki script URL (where the view, edit, etc. scripts are stored). TWiki creates this URL (AFAIK) by adding %SCRIPTURLPATH% onto the end of %defaultUrlHost%.
%SCRIPTSUFFIX% () -- some versions of Perl (Windows versions?) apparently require a ".pl" extension to the script file names and hence a script suffix. Then I presume URLs would have to be of the form
http://192.168.0.8/w/view.pl/Sandbox/TWikiVariables
, and all the scripts have to be renamed to include a .pl extension.
%PUBURLPATH% (/p/pub) -- must be set (manually) to a value so that this path will lead to the /pub directory for this installation of TWiki. The pub directory for my home LAN is at /home/httpd/twiki/pub/. An alias for /home/httpd/twiki/ is "/" (from the Alias line above), so the %PUBURLPATH% for this TWiki must be set to "/pub". (Note the absence of a final slash in "/pub" -- I can't easily or immediately explain why the difference, but it seems to be required.) See the next item.
%PUBURL% (
https://twiki.org/p/pub) -- this is the base TWiki pub URL (where icons, attached files, and other things that TWiki may "serve" as objects are stored). TWiki creates this URL (AFAIK) by adding %PUBURLPATH% onto the end of %defaultUrlHost%.
%pubDir% -- this is the "real" "filesystem path" on the Web server to the /pub directory. On my home TWiki it is /home/httpd/twiki/pub/. Apache can determine this from the Alias line in httpd.conf. (I'm not sure whether TWiki needs this or how it gets it.)
%templateDir% -- later
%dataDir% -- later
%ATTACHURLPATH% (/p/pub/Wikilearn/TWikiVariablesForTWikiNewbies) -- TWiki creates directories for each topic to store attachments to that topic. The directories are created under the /pub directory, under subdirectories named for the particular Web. So, attachments for
http://192.168.0.8/v/Sandbox/TWikiVariables
would be stored under directory /home/httpd/twiki/pub/Sandbox/TWikiVariables/. The %ATTACHURLPATH% is created by TWiki by combining $pubDir$ (/home/httpd/twiki/pub/), %WEB% (Sandbox), and %WEB% (
TWikiVariables).
%ATTACHURL% (
https://twiki.org/p/pub/Wikilearn/TWikiVariablesForTWikiNewbies) -- see %ATTACHURLPATH%. TWiki creates the %ATTACHURL% by combining %defaultUrlHost% and %ATTACHURLPATH%.
%DATE% (2026-01-03) -- the current date (determined by TWiki (?), from the local system clock (?))
%WIKIVERSION% (TWiki-6.1.1-branch, Sun, 02 Jul 2023, build 31079) -- the version of TWiki used at this site, expressed as the release date.
%USERNAME% (guest) -- login user name (more later(?), but here's a start) -- I don't know where the user name comes from in every case. If you log in to a local LAN with a userid, that userid is your %USERNAME%(?). On twiki.org, until you've logged in, your username is "guest", which corresponds to %WIKIUSERNAME%
TWikiGuest. After you've logged in (on twiki.org), your %USERNAME% is the same as your %WIKIUSERNAME% (in my case
RandyKramer).
%WIKIUSERNAME% (
TWikiGuest) -- The
WikiWord you've chosen to use as your (nick)name on TWiki. See %USERNAME%.
%WIKITOOLNAME% (TWiki) -- the name that you choose to give to your TWiki website. On twiki.org, it is "TWiki". On my public twiki site (under construction), it will be "WikiLearn". At the top of a typical twiki page (with the default template) you will see the "page name" displayed something like:
WikiLearn . Sandbox .
TWikiVariables
The
WikiLearn is displayed because the template displays %WIKITOOLNAME% . %WEB%
%TOPIC%
I am sure that this is not the only use for %WIKITOOLNAME%
%MAINWEB% (Main) -- in TWiki there are two special webs that must exist for special purposes. Originally they were "hardnamed" "Main" and "TWiki". Now, through the use of this and the next variable, you can rename them as desired (with appropriate care or changes in other places). The %MAINWEB% (default "Main") contains:
- Registered user's home pages (automatically created by TWiki upon registration) (and must be removed and recreated for reregistration (still?)). Thus signatures (in all webs) should be of the form Main.RandyKramer, or preferably %MAINWEB%.RandyKramer to allow for possible future renaming of the %MAINWEB%.
- Main.TWikiUser -- the list of all registered users on a TWiki
- Definition of groups, like the Admin group and other user groups that may be created.
- more?
%TWIKIWEB% (TWiki06x01) -- This is the other of two special webs that must (should?) exist. (See %MAINWEB%.) The %MAINWEB% (default "TWiki") is used to store:
- (standard) documentation for installing and using TWiki (I expect to be adding additional documentation, and, for ease in upgrading (avoiding loss or overwriting of customized documentation), that customized documentation will be stored in a different web, unless it is adopted as part of the TWiki standard documentation. *
- more?
%HOMETOPIC% (
WebHome) -- a topic present in each Web that is in some sense the home topic -- if a TWiki URL includes a web name but no topic, the %MAINWEB% is displayed (default is
WebHome).
%NOTIFYTOPIC% (
WebNotify) -- a topic present in each Web that contains the list of (usually registered) users who wish to be notified by email when any topic in that web has been changed (default is
WebNotify). Registered users can edit that page and add their names and email addresses. Notification is setup to work off a cron job, notification on twiki.org is once per day. (Email addresses have a simple / primitive means of being blocked to avoid being harvested and used for spam.) There is currently no means in TWiki to achieve email notification on a per topic basis. Policy changes on
SourceForge (after 20010911) may force a change to a different server or approach.
%WIKIUSERSTOPIC% (
TWikiUsers) -- the topic used to store the list of registered users (defaults to
TWikiUsers, in the %MAINWEB%). Until the 20010901 release, user names had to be deleted from here to allow reregistration. (And their home pages had to be deleted and their entry in .htpasswd. (??))
%WIKIPREFSTOPIC% (
TWikiPreferences) -- a topic in the %TWIKIWEB%that stores site-level preferences for this installation of TWiki (defaults to
TWikiPreferences). See that topic for an example of preferences that can be set. Preferences can be set for an entire site, a web, or for a user. See the next item. Personal preferences are set on the home page of each registered twiki user (in the %MAINWEB%.
%WEBPREFSTOPIC% (
WebPreferences) -- a topic in each web that stores web-level preferences for a given web on a twiki installation (defaults to
WebPreferences). See that topic for an example of preferences that can be set.
%STATISTICSTOPIC% (
WebStatistics) -- a topic in each web that is used to collect and display statistics for the topics in that web(default is
WebStatistics). See a page for examples. Statistics can be collected automatically once per day, but require some setup. See the installation instructions.
%INCLUDE{...}% (No example yet --
TWiki® - the Open Source Enterprise Wiki and Web Application Platform
) -- (server side include) This variable, and some others (%INCLUDESTART%, %INCLUDESTOP%) allow all or a portion of one twiki topic to be included on another page. This is useful for various reasons, including, in the present design, creating a complete Table of Contents for a topic that is divided among several pages for convenience (smaller pages for easier editing, and so forth).
%SEARCH{convenience}% (example below) -- This variable allows the inclusion of the results of an inline search on a TWiki page. The following is an example of the results of an inline search on
WikiLearn:
<inline search results>
Searched: convenience
This is, more or less, a diary of the ChurchServerProject. See AboutThesePages. Contents: 20020115 I have registered as an official TWiki user and took a look around...
If you want to send and receive email, send instant messages to your friends, or surf the web (to find information on almost anything), you will need a connection...
refactoring in progress I finally have email setup on my Linux systems the way I want it. (I run a home LAN with Windows and Linux clients, and my setup includes...
Ok, I finally got my email server working, and now need to document it and remove the `cruft` from WikiLearn. I`ll start by giving an overview of my setup and making...
This page is intended to provide the information needed to create a file readable by the info viewer program in any plain text editor which allows entry of arbitrary...
Listing some complaints I have about Konqueror 3.1. Listing them here before submitting as bugs to allow some time to think and/or learn more. (Maybe workarounds...
Mahogany is a cross platform (at least Windows and Linux) mail client based on wxWindows (and written in wxPython or C ??). It seems aimed a little bit more towards...
A page to collect my thoughts on organizing TWiki by (multi level) webs versus by the parent/child `bread crumb trail`. My impression is that PeterTheony prefers...
And now a `checkpoint save` from my offline editing. Now copied back offline for local editing (based on Rev. 1.4 Simply copying my `offline` start here for editing...
Opera Doesn`t Work After DNS Change (Mandriva2006) Keywords / Phrases / Alternate Titles (for search add some): After DNS (or related) changes, opera thinks...
Introduction For people arriving from other websites: This site is powered by TWiki, a flexible, powerful, and easy to use enterprise collaboration platform. TWiki...
Set Focus Stealing Prevention per Window / Application on KDE 3.5 Prevent your web browser from popping up over your email client when you click on a link in an...
This page (topic) comes from a .leo file which provides additional documentation for TWiki. By cutting and pasting it to a working TWiki, you can see the actual values...
This whole `trusted computer` (aka `Digital Rights Management`) thing is not about providing a computer you can trust, but rather a computer `they` can trust. I...
This is a list (or several lists) of todos for WikiLearn it is somewhat of a mess at this point. I had hoped to have some help in doing these tasks since no one...
Starting a series of pages to record notes, progress, musings, whatever as I try to patch the X11 X server to incorporate a keyboard macro facility. Objective: The...
Number of topics: 16
</inline search results>
--
RandyKramer - 23 Jul 2001