none
authorMikeMannix <MikeMannix>
Sat, 15 Sep 2001 05:49:30 +0000 (05:49 +0000)
committerMikeMannix <MikeMannix>
Sat, 15 Sep 2001 05:49:30 +0000 (05:49 +0000)
TWiki/TWikiInstallationGuide.mdwn
TWiki/TWikiTemplates.mdwn
TWiki/TextFormattingFAQ.mdwn
TWiki/WebHome.mdwn

index 2c29242..5ae9078 100644 (file)
@@ -44,12 +44,13 @@ Request and download the TWiki 01-Sep-2001 distribution in Unix ZIP format from
 
 ### <a name="Step 1: Create  Configure the Di"></a> Step 1: Create &amp; Configure the Directories
 
-**_NOTE:_** _If you don't have access to your Web server configuration files - for example, if you're installing on an ISP-hosted account - use the [[alternative Step 1|Main/WebHome#StepOneB]] instead._
+- **_NOTE:_** _If you don't have access to your Web server configuration files - for example, if you're installing on an ISP-hosted account - use the [[alternative Step 1|Main/WebHome#StepOneB]] instead._
+- **_NOTE:_** To install TWiki on SourceForge, for use on a software development project, read TWiki:Codev/SourceForgeHowTo.
 
 - Create directory `/home/httpd/twiki` and unzip the TWiki distribution into this directory.
 - The `twiki/bin` directory of TWiki must be set as a cgi-bin directory. Add `/home/httpd/twiki/bin` to file `/etc/httpd/httpd.conf` with only `ExecCGI` option.
 - The `twiki/pub` directory of TWiki must be set so that it is visible as a URL. Add `/home/httpd/twiki` to file `httpd.conf` with normal access options (copy from `/home/httpd/html` ).
-- Now add `ScriptAlias` for `/twiki/bin` and `Alias` for `/twiki` to file `httpd.conf` . <br />**_Note:_** The `ScriptAlias` **must** come before the `Alias` in Apache, otherwise it will fail to correctly set up `/twiki/bin/` , due to the fact that it sees that as being just another subdirectory of the `/twiki/` alias. <br />
+- Now add `ScriptAlias` for `/twiki/bin` and `Alias` for `/twiki` to file `httpd.conf` . <br />**_NOTE:_** The `ScriptAlias` **_must_** come before the `Alias`, otherwise, Apache will fail to correctly set up `/twiki/bin/`, by treating it as just another subdirectory of the `/twiki/` alias.
 
 > **Example `httpd.conf` entries:**
 >
@@ -88,13 +89,13 @@ To install TWiki on a system where you don't have server administrator privilege
 >   <tr>
 >     <td><code>twiki/bin</code></td>
 >     <td> CGI bin </td>
->     <td> cgi-bin enabled dir </td>
+>     <td> cgi-enabled dir </td>
 >     <td><code>/home/smith/public_html/cgi-bin</code></td>
 >   </tr>
 >   <tr>
 >     <td><code>twiki/lib</code></td>
 >     <td> library files </td>
->     <td> same level like <code>twiki/bin</code></td>
+>     <td> same level as <code>twiki/bin</code></td>
 >     <td><code>/home/smith/public_html/lib</code></td>
 >   </tr>
 >   <tr>
@@ -116,8 +117,6 @@ To install TWiki on a system where you don't have server administrator privilege
 >     <td><code>/home/smith/twiki/templates</code></td>
 >   </tr>
 > </table>
->
-> (Read TWiki:Codev/SourceForgeHowTo in case you want to install TWiki on SourceForge, to use on a software development project.)
 
 <a name="StepTwo"></a>
 
index 27c8797..1d9a348 100644 (file)
@@ -4,13 +4,21 @@
         <li><a href="#Overview"> Overview</a></li>
         <li><a href="#Major changes from the previous"> Major changes from the previous template system</a></li>
         <li><a href="#Functional Specifications"> Functional Specifications</a></li>
-        <li><a href="#New Template System by Example"> New Template System by Example</a><ul>
+        <li><a href="#TWiki Master Template"> TWiki Master Template</a></li>
+        <li><a href="#Types of Template"> Types of Template</a><ul>
+            <li><a href="#HTML Page Templates"> HTML Page Templates</a></li>
+            <li><a href="#Template Topics"> Template Topics</a><ul>
+                <li><a href="#Template Topics in Action"> Template Topics in Action</a></li>
+              </ul>
+            </li>
+          </ul>
+        </li>
+        <li><a href="#Templates by Example"> Templates by Example</a><ul>
             <li><a href="#Base template oopsbase.tmpl"> Base template oopsbase.tmpl</a></li>
             <li><a href="#Test template oopstest.tmpl"> Test template oopstest.tmpl</a></li>
             <li><a href="#Sample screen shot of oopstest.t"> Sample screen shot of oopstest.tmpl</a></li>
           </ul>
         </li>
-        <li><a href="#TWiki master template"> TWiki master template</a></li>
         <li><a href="#Known Issues"> Known Issues</a></li>
       </ul>
     </li>
@@ -51,7 +59,117 @@ The main difference is that templates are now defined using variables to include
 - Templates and [[TWikiSkins]] work transparently and interchangeably. For example, you can create a skin that overloads just the `twiki.tmpl`, like `twiki.print.tmpl`, that redefines the header and footer.
 - **_Note:_** The template directives work only for templates, they do not get processed in topic text.
 
-## <a name="New Template System by Example"></a> New Template System by Example
+## <a name="TWiki Master Template"></a> TWiki Master Template
+
+All common parts are defined in a master template, <code>**twiki.tmpl**</code>, that all other templates use.
+
+> <table border="1" cellpadding="0" cellspacing="0">
+>   <tr>
+>     <th bgcolor="#99CCCC"><strong> Template variable: </strong></th>
+>     <th bgcolor="#99CCCC"><strong> Defines: </strong></th>
+>   </tr>
+>   <tr>
+>     <td> %TMPL:DEF{"sep"}% </td>
+>     <td> "|" separator </td>
+>   </tr>
+>   <tr>
+>     <td> %TMPL:DEF{"htmldoctype"}% </td>
+>     <td> Start of all HTML pages </td>
+>   </tr>
+>   <tr>
+>     <td> %TMPL:DEF{"standardheader"}% </td>
+>     <td> Standard header (ex: view, index, seach) </td>
+>   </tr>
+>   <tr>
+>     <td> %TMPL:DEF{"simpleheader"}% </td>
+>     <td> Simple header with reduced links (ex: edit, attach, oops) </td>
+>   </tr>
+>   <tr>
+>     <td> %TMPL:DEF{"standardfooter"}% </td>
+>     <td> Footer, excluding revision and copyright parts </td>
+>   </tr>
+>   <tr>
+>     <td> %TMPL:DEF{"oops"}% </td>
+>     <td> Skeleton of oops dialog </td>
+>   </tr>
+> </table>
+
+## <a name="Types of Template"></a> Types of Template
+
+There are two types of templates:
+
+- **HTML Page Templates**: Defines layout of %WIKITOOLNAME% pages
+- **Template Topics**: Defines default text when you create a new topic
+
+### <a name="HTML Page Templates"></a> HTML Page Templates
+
+%WIKITOOLNAME% uses HTML template files for all actions like topic view, edit, preview and so on. This allows you to change the look and feel of all pages by editing just some template files.
+
+The template files are in the <code>**twiki/templates**</code> directory. As an example, <code>**twiki/templates/view.tmpl**</code> is the template file for the <code>**twiki/bin/view**</code> script. Templates can be overloaded per web. The following search order applies:
+
+1. <code>**twiki/templates/$webName/$scriptName.tmpl**</code>
+2. <code>**twiki/templates/$scriptName.tmpl**</code>
+
+**_Note:_** <code>**$webName**</code> is the name of the web ( i.e. <code>**Main**</code> ), and <code>**$scriptName**</code> is the script ( i.e. <code>**view**</code> ).
+
+**_Note:_** [[TWikiSkins]] can be defined to overload the standard templates.
+
+Some special variables are used in templates ( especially <code>**view**</code> ) to show meta data - see [[Meta Data Rendering|Main/TWikiDocumentation#Meta_Data_Rendering]]
+
+### <a name="Template Topics"></a> Template Topics
+
+Template topics define the default text for new topics. There are three types of template topics:
+
+> <table border="1" cellpadding="0" cellspacing="0">
+>   <tr>
+>     <th bgcolor="#99CCCC"><strong> Topic Name: </strong></th>
+>     <th bgcolor="#99CCCC"><strong> What it is: </strong></th>
+>   </tr>
+>   <tr>
+>     <td>[[Main/WebTopicViewTemplate]]</td>
+>     <td> Help text shown when you view a non existing topic. </td>
+>   </tr>
+>   <tr>
+>     <td>[[Main/WebTopicNonWikiTemplate]]</td>
+>     <td> Help text shown when you view a non existing topic that has not a [[Main/WikiName]]. </td>
+>   </tr>
+>   <tr>
+>     <td>[[Main/WebTopicEditTemplate]]</td>
+>     <td> Default text shown when you create a new topic. </td>
+>   </tr>
+> </table>
+
+All template topics are located in the TWiki web. The [[WebTopicEditTemplate]] can be overloaded. The following search order applies when you create a new topic:
+
+1. The topic name specified by the `templatetopic` parameter.
+2. WebTopicEditTemplate in the current web.
+3. WebTopicEditTemplate in the TWiki web.
+
+#### <a name="Template Topics in Action"></a> Template Topics in Action
+
+Here is an example for creating new topics based on a specific template topic:
+
+<form action="http://www.dementia.org/twiki//edit/%WEB%/" name="new">
+  <ul>
+    <li> New example topic: <input name="topic" size="22" type="text" value="ExampleTopic20100629" /> <input name="templatetopic" type="hidden" value="ExampleTopicTemplate" /> <input type="submit" value="Create" /> (date format is YYYYMMDD) </li>
+  </ul>
+</form>
+
+Above form asks for a topic name. A hidden input tag of name "templatetopic" specifies the [[ExampleTopicTemplate]] as the template topic. Here is the HTML source of the form:
+
+    <form name="new" action="%SCRIPTURLPATH%/edit%SCRIPTSUFFIX%/%WEB%/">
+       * New example topic:
+         <input type="text" name="topic" value="ExampleTopic%SERVERTIME{$year$mo$day}%" size="22">
+         <input type="hidden" name="templatetopic" value="ExampleTopicTemplate">
+         <input type="hidden" name="onlywikiname" value="on">
+         <input type="submit" value="Create"> (date format is YYYYMMDD)
+    </form>
+
+The "onlywikiname" parameter enforces [[WikiWords]] for topic names.
+
+**_Note:_** Use can use the `%WIKIUSERNAME%` and `%DATE%` variables in your topic templates as the signature; those variables are expanded when a new topic is created. The standard topic signature is: <br />`-- %WIKIUSERNAME% - %DATE%`
+
+## <a name="Templates by Example"></a> Templates by Example
 
 Attached is an example of an oops base template `oopsbase.tmpl` and a example oops dialog `oopstest.tmpl` which is based on the base template. **_NOTE:_** This isn't the release version, just a quick, simple demo.
 
@@ -59,7 +177,7 @@ Attached is an example of an oops base template `oopsbase.tmpl` and a example oo
 
 The first line declares the delimiter variable called "sep", used to separate multiple link items. The variable can be called anywhere by writing `%TMPL:P{"sep"}%`
 
-> <table border="1" cellpadding="1" cellspacing="0">
+> <table bgcolor="#f5f5f5" border="1" cellpadding="1" cellspacing="0">
 >   <tr>
 >     <td><pre>
 > %TMPL:DEF{"sep"}% | %TMPL:END%
@@ -107,7 +225,7 @@ The first line declares the delimiter variable called "sep", used to separate mu
 
 Each oops template basically just defines some variables and includes the base template that does the layout work.
 
-> <table border="1" cellpadding="1" cellspacing="0">
+> <table bgcolor="#f5f5f5" border="1" cellpadding="1" cellspacing="0">
 >   <tr>
 >     <td><pre>
 > %TMPL:DEF{"titleaction"}% (test =titleaction=) %TMPL:END%
@@ -145,54 +263,8 @@ With URL: <code>**.../bin/oops/Test/TestTopic2?template=oopstest&amp;param1=WebH
 >   </tr>
 > </table>
 
-## <a name="TWiki master template"></a> TWiki master template
-
-All common template parts are defined in one master template, `twiki.tmpl`, that all other templates include.
-
-<table border="1" cellpadding="0" cellspacing="0">
-  <tr>
-    <th bgcolor="#99CCCC"><strong> Template variable: </strong></th>
-    <th bgcolor="#99CCCC"><strong> Defines: </strong></th>
-  </tr>
-  <tr>
-    <td> %TMPL:DEF{"sep"}% </td>
-    <td> "|" separator </td>
-  </tr>
-  <tr>
-    <td> %TMPL:DEF{"htmldoctype"}% </td>
-    <td> Start of all HTML pages </td>
-  </tr>
-  <tr>
-    <td> %TMPL:DEF{"standardheader"}% </td>
-    <td> Standard header (ex: view, index, seach) </td>
-  </tr>
-  <tr>
-    <td> %TMPL:DEF{"simpleheader"}% </td>
-    <td> Simple header with reduced links (ex: edit, attach, oops) </td>
-  </tr>
-  <tr>
-    <td> %TMPL:DEF{"standardfooter"}% </td>
-    <td> Footer, excluding revision and copyright parts </td>
-  </tr>
-  <tr>
-    <td> %TMPL:DEF{"oops"}% </td>
-    <td> Skeleton of oops dialog </td>
-  </tr>
-</table>
-
-> **Example: `oopspreview.tmpl` template**
->
->     %TMPL:INCLUDE{"twiki"}%
->     %TMPL:DEF{"titleaction"}% (oops) %TMPL:END%
->     %TMPL:DEF{"webaction"}% *Attention* %TMPL:END%
->     %TMPL:DEF{"heading"}% Topic is not saved yet %TMPL:END%
->     %TMPL:DEF{"message"}% Please go back in your browser and save the topic. %TMPL:END%
->     %TMPL:DEF{"topicaction"}%
->     %TMPL:END%
->     %TMPL:P{"oops"}%
-
 ## <a name="Known Issues"></a> Known Issues
 
 - A drawback of referring to a master template is that you can only test a template from within TWiki, where the include variables are resolved. In the previous system, each template is a structurally complete HTML document with a `.tmpl` filename extension - it contains unresolved `%VARIABLES%`, but can still be previewed directly in a browser.
 
--- [[PeterThoeny]] - 23 Jul 2001 <br /> -- [[MikeMannix]] - 30 Aug 2001
+-- [[PeterThoeny]] - 23 Jul 2001 <br /> -- [[MikeMannix]] - 14 Sep 2001 <br />
index 2886fa6..601fcae 100644 (file)
@@ -11,7 +11,7 @@ The most frequently asked questions about text formatting are answered. Also, [[
     <li><a href="#How can I write fixed font text?"> How can I write fixed font text?</a></li>
     <li><a href="#Text I enter gets wrapped around"> Text I enter gets wrapped around. How can I keep the formatting as it is?</a></li>
     <li><a href="#How do I create tables?"> How do I create tables?</a></li>
-    <li><a href="#Can I include images and picture"> Can I include images and pictures?</a></li>
+    <li><a href="#Can I include images on a page?"> Can I include images on a page?</a></li>
     <li><a href="#Can I write colored text?"> Can I write colored text?</a></li>
   </ul>
 </div>
@@ -20,7 +20,7 @@ The most frequently asked questions about text formatting are answered. Also, [[
 >
 > ### <a name="How do I make a separator?"></a> How do I make a separator?
 >
-> You can make a horizontal separator by entering three dashes at the beginning of a line: `---`.
+> Create a separator - a horizontal rule - by entering three dashes at the beginning of a blank line: `---`. You can enter more than three if you like, for a more visible separator in edit mode: <br />`--------------`
 >
 > ----
 >
@@ -36,7 +36,7 @@ The most frequently asked questions about text formatting are answered. Also, [[
 >
 > ### <a name="Text enclosed in angle brackets"></a><a name="Text enclosed in angle brackets "></a> Text enclosed in angle brackets like &lt;filename&gt; is not displayed. How can I show it as it is?
 >
-> TWiki interprets text as HTML. The '&lt;' and '&gt;' characters are used to define HTML commands. Text contained in angle brackets is interpreted by the browser if it's a valid HTML instruction, or ignored if it isn't - either way, the brackets and its contents are not displayed.
+> TWiki interprets text as HTML, and the '&lt;' and '&gt;' characters define where HTML commands start and end. Text _inside_ angle brackets is treated as HTML, and ignored if it doesn't actually do anything - either way, the brackets and its contents are not displayed.
 >
 > If you want to display angle brackets, enter them as HTML codes instead of typing them in directly:
 >
@@ -68,7 +68,7 @@ The most frequently asked questions about text formatting are answered. Also, [[
 >
 > ### <a name="Text I enter gets wrapped around"></a> Text I enter gets wrapped around. How can I keep the formatting as it is?
 >
-> TWiki interprets text as HTML, so you can use the `preformatted` HTML text option to keep the new line of text as is. Enclose the text in &lt;pre&gt; &lt;/pre&gt;, or in TWiki's own &lt;verbatim&gt; &lt;/verbatim&gt; tags:
+> TWiki interprets text as HTML, so you can use the `preformatted` HTML option to keep the new line of text as is. Enclose the text in &lt;pre&gt; &lt;/pre&gt;, or in TWiki's own &lt;verbatim&gt; &lt;/verbatim&gt; tag:
 >
 >     This text will keep its format as it is:
 >     <verbatim>
@@ -77,7 +77,7 @@ The most frequently asked questions about text formatting are answered. Also, [[
 >       aaa             12.00   3      36.00
 >     </verbatim>
 >
-> The `pre` tag is standard HTML; `verbatim` is a special TWiki tag that also forces text to fixed font mode, and also prevents other tags and TWiki shortcuts from being expanded.
+> The `pre` tag is standard HTML; `verbatim` is a special TWiki tag that forces text to fixed font mode, and also prevents other tags and TWiki shortcuts from being expanded.
 >
 > ----
 >
@@ -144,31 +144,35 @@ The most frequently asked questions about text formatting are answered. Also, [[
 >
 > ----
 >
-> ### <a name="Can I include images and picture"></a> Can I include images and pictures?
+> ### <a name="Can I include images on a page?"></a> Can I include images on a page?
 >
-> Yes, this is possible. The easiest way of including images is to attach a GIF, JPG or PNG file to a topic and then to include it with text `%ATTACHURL%/myImage.gif` . [[FileAttachment]] has more.
+> Yes. The easiest way is to [[attach|Main/FileAttachment]] a GIF, JPG or PNG file to a topic and then to place it with: `%ATTACHURL%/myImage.gif`. This works only for the page that the image is attached to.
 >
-> There are actually two ways of including inline images.
+> To place an image on any page, ther are two ways of including inline images.
 >
 > **1\. Using URL ending in .gif, .jpg, .jpeg, .png**
 >
-> This is a simple and automatic way of including inline images. Simply write the URL of the image file, this will create the inline image for you. **Note:** The images must be accessible as a URL.
+> This is a simple and automatic way of including inline images. Simply write the URL of the image file, this will create the inline image for you. **_NOTE:_** The images must be [[accessible|Main/WebHome#ImgUpload]] as a URL.
 >
 > - **_You enter:_** ` TWiki http://www.dementia.org/twiki//view/wikiHome.gif logo.`<br />**_Result:_** TWiki ![wikiHome.gif](http://www.dementia.org/twiki//view/wikiHome.gif) logo.
 >
+> <a name="ImgUpload"></a> You can upload images directly to your server with FTP access. You can also [[attach|Main/FileAttachment]] image files to a topic - you could even create a dedicated image topic, like `ImageLibrary` - and then link to the images directly:
+>
+> - Attach `pic.gif` to `Someweb.SomeTopic`<br /> Display with <code>http://www.dementia.org/twiki//view/Someweb/SomeTopic/pic.gif</code>
+>
 > **2\. Using &lt;img&gt; tag**
 >
-> This is a manual process where you have more control over the rendering of the image. Use the &lt;img&gt; tag of HTML to include GIF, JPG and PNG files. **Note:** The display of the topic is faster if you include the WIDTH and HEIGHT parameters that have the actual image size. <http://www.htmlhelp.com/reference/wilbur/special/img.html> has more on inline images.
+> This is a manual process where you have more control over the rendering of the image. Use the &lt;img&gt; tag of HTML to include GIF, JPG and PNG files. **Note:** The display of the topic is faster if you include the `WIDTH` and `HEIGHT` parameters that have the actual image size. <http://www.htmlhelp.com/reference/wilbur/special/img.html> has more on inline images.
 >
-> - **_You enter:_** `TWiki <img src="http://www.dementia.org/twiki//view/wikiHome.gif" width="46" height="50" /> logo.`<br />**_Result:_**<br /> TWiki <img src="http://www.dementia.org/twiki//view/wikiHome.gif" width="46" height="50" /> logo.
+> - **_You enter:_** `TWiki <img src="http://www.dementia.org/twiki//view/wikiHome.gif" width="46" height="50" border="0" alt="logo" /> logo.`<br />**_Result:_**<br /> TWiki <img src="http://www.dementia.org/twiki//view/wikiHome.gif" width="46" height="50" alt="logo" /> logo.
 >
 > ----
 >
 > ### <a name="Can I write colored text?"></a> Can I write colored text?
 >
-> Sure. The quickest way is to use the &lt;font color="colorCode"&gt; and &lt;/font&gt; tags - they're HTML tags that work in any browser, (although they've been phased in the latest version).
+> Sure. The quickest way is to go &lt;font color="colorCode"&gt;colorize&lt;/font&gt; - `font` is an HTML tag that works in any browser, although it's been phased out in the latest HTML specs.
 >
-> You can also use a `style` attribute: `style="color:#ff0000"`, placed in most HTML tags - `span` is an all-purpose choice: "&lt;span style="color:#ff0000"&gt;.
+> You can also use the up-to-date `style` attribute - ex: `style="color:#ff0000"` - placed in most HTML tags. `span` is an all-purpose choice: "&lt;span style="color:#ff0000"&gt;CoLoR&lt;/span&gt;. Only old (like 3.x IE &amp; NS) browsers have a problem with `style`.
 >
 > "colorCode" is the _hexadecimal RGB color code_, which is simply Red, Green and Blue values in hex notation (base 16, 0-F). For pure red, the RGB components are 255-0-0 - full red (255), no green or blue. That's FF-0-0 in hex, or <code>"#ff000=" for Web page purposes. For a basic color selection (you can [[StandardColor|Main/StandardColors]] names instead of hex code in the =font</code> tag only):
 >
index dd0cc3e..e8d0c57 100644 (file)
@@ -38,9 +38,9 @@
 
 - - [[TWikiHistory]]: The TWiki development timeline
   - [[TWikiDocumentation]]: Complete current reference...
-    1. [[TWiki System Requirements|Main/TWikiImplementationNotes]]
-    2. [[TWiki Installation Guide|Main/TWikiInstallationGuide]]
-    3. [[TWiki Upgrade Guide|Main/TWikiUpgradeGuide]]
+    1. [[System Requirements|Main/TWikiImplementationNotes]]
+    2. [[Installation Guide|Main/TWikiInstallationGuide]]
+    3. [[Upgrade Guide|Main/TWikiUpgradeGuide]]
     4. [[User Authentication|Main/TWikiUserAuthentication]]
     5. [[Access Control|Main/TWikiAccessControl]]
     6. [[TWikiTemplates]]
@@ -50,9 +50,9 @@
     10. [[TWikiForms]]
     11. [[TWikiPlugins]]
     12. [[Monitoring Activity|Main/MonitoringSiteActivity]]
-    13. [[Managing Topics|Main/ManagingTopics]]
+    13. [[Managing Pages|Main/ManagingTopics]]
     14. [[Managing Webs|Main/ManagingWebs]]
-    15. [[A: TWiki File System|Main/AppendixFileSystem]]
+    15. [[A - TWiki File System|Main/AppendixFileSystem]]
 
 ### <a name="TWiki Site Tools"></a> TWiki Site Tools
 
@@ -75,6 +75,6 @@ Site tools include utilities for navigating and keeping up with site activity on
 
 - TWiki<sup>TM</sup> is a trademark of [[PeterThoeny]]
 - TWiki is developed as Free Software under the [[GNU/GPL|Main/GnuGeneralPublicLicense]]
-- Get the current version from [TWiki.org Downloads](http://TWiki.org/download.html)<br /> %TLS%
+- Get the current version from [TWiki.org Downloads](http://TWiki.org/download.html)<br />![twikilogo88x31.gif](http://www.dementia.org/twiki//view/twikilogo88x31.gif)
 
 -- [[MikeMannix]] - 14 Sep 2001 <br />