netfrag.org > TWiki > TWikiDocumentation (r1.38 vs. r1.39)
TWiki . { Home? | Welcome | Register | Changes | Index | Search | Go }

 <<O>>  Difference Topic TWikiDocumentation (r1.39 - 03 Dec 2001 - MikeMannix?)
Line: 1 40 to 1 40
Changed:
<
<

TWiki Formatted Search Results

Inline search feature allows flexible formatting of search result

Overview

By default, the format for displaying a search result is fixed, e.g. a table with rows of topic name and topic summary. Use the format="..." parameter to specify a customized format of the search result. The string of the format parameter is typically a bullet list or table row containing variables (i.e. %SEARCH{ "food" format="| $topic | $summary |" }%).

Syntax

Two paramters can be used to specify a customized search result:

1. header="..." parameter

Use the header paramter to specify the header of a search result. It should correspond to the format of the format parameter. This parameter is optional. I.e.
header="| *Topic:* | *Summary:* |"

2. format="..." parameter

Use the format paramter to specify the format of one search hit. I.e.
format="| $topic | $summary |"

Variables that can be used in the format string:

Name: Expands To:
$n New line
$web Name of the web
$topic Topic name
$locked LOCKED flag (if any)
$date Time stamp of last topic update, i.e. 28 Mar 2024 - 10:01
$isodate Time stamp of last topic update, i.e. 2024-03-28T10:01Z
$rev Number of last topic revision, i.e. 1.4
$wikiusername Wiki user name of last topic update, i.e. Main.JohnSmith
$username User name of last topic update, i.e. JohnSmith
$summary Topic summary
$formfield(name) The field value of a form field, i.e. $formfield(TopicClassification) would get expanded to PublicFAQ. This applies only to topics that have a TWikiForm
$pattern(reg-exp) A regular expression pattern to extract some text from a topic, i.e. $pattern(.*?\*.*?Email\:\s*([^\n\r]+).*) extracts the email address from a bullet of format * Email: ....

Note: For $pattern(reg-exp), specify a RegularExpression that scans from start to end and contains the text you want to keep in parenthesis, i.e. $pattern(.*?(from here.*?to here).*). You need to make sure that the integrity of a web page is not compromised, i.e. if you include a table make sure to include everything including the table end tag.

Examples

Bullet list showing topic name and summary

Write this:

%SEARCH{ "FAQ" scope="topic" nosearch="on" nototal="on" header="   * *Topic: Summary:*" format="   * [[$topic]]: $summary" }%

To get this:

  • Topic: Summary:
  • TWikiFAQ: Frequently Asked Questions About TWiki This is a real FAQ, and also a demo of one easily implemented knowledge base solution. See how it's done, click Edit . SEARCH ...
  • TWikiFaqTemplate: FAQ: Answer: Back to: NOP TWikiFAQ WIKIUSERNAME DATE
  • TextFormattingFAQ: Text Formatting FAQ The most frequently asked questions about text formatting are answered. Also, TextFormattingRules contains the complete TWiki shorthand system ...

Table showing form field values of topics with a form

Write this in the Know web:

| *Topic:* | *OperatingSystem:* | *OsVersion:* |
%SEARCH{ "[T]opicClassification.*?value=\"[P]ublicFAQ\"" scope="text" regex="on" nosearch="on" nototal="on" format="| [[$topic]] | $formfield(OperatingSystem) | $formfield(OsVersion) |" }%

To get this:

Topic: OperatingSystem: OsVersion:
IncorrectDllVersionW32PTH10DLL OsWin 95/98
WinDoze95Crash OsWin 95

Extract some text from a topic using regular expression

Write this:

%SEARCH{ "__Back to\:__ TWikiFAQ" scope="text" regex="on" nosearch="on" nototal="on" header="TWiki FAQs:" format="   * $pattern(.*?FAQ\:[\n\r]*([^\n\r]+).*) [[$topic][Answer...]]" }%

To get this:

TWiki FAQs:

  • How do I delete or rename a topic? Answer...
  • Why does the topic revision not increase when I edit a topic? Answer...
  • TWiki has a GPL (GNU General Public License). What is GPL? Answer...
  • I've problems with the WebSearch. There is no Search Result on any inquiry. By clicking the Index topic it's the same problem. Answer...
  • What happens if two of us try to edit the same topic simultaneously? Answer...
  • I would like to install TWiki on my server. Can I get the source? Answer...
  • So what is this WikiWiki thing exactly? Answer...
  • Everybody can edit any page, this is scary. Doesn't that lead to chaos? Answer...

-- PeterThoeny? - 28 Nov 2001

>
>

File Attachments

Each topic can have files attached to it, similar to an email attachment. Use your browser to upload or download a file. Attachments are stored under revision control, so uploads can never be lost, and files changes can be made with a rollback option that lets you retrieve all previous versions.

What Are Attachments Good For?

File Attachments can be used to create powerful groupware solutions - file sharing, document management - and for speedy Web authoring.

Document Management System

  • You can use Attachments to store and retrieve documents (in any format, with associated graphics, and other media files); attach documents to specific TWiki topics; collaborate on documents with full revision control; distribute documents on a need-to-know basis using; create a central reference library that's easy to access and manage by an entire user group.

File Sharing

  • For file sharing, FileAttachments on a series of topics can be used to quickly create a well-documented, categorized digital download center for all types of files: documents; graphics and other media; drivers and patches; applications; anything you can safely upload!

Web Authoring

  • Through your Web browser, you can easily upload graphics (or sound files, or anything else you want to embed on a page) and place them anywhere in on a single page, or for use across a web, or site-wide.
    • NOTE: You can also add graphics - any files - directly, typically by FTP upload. This requires server access, and may be more convenient if a large number of files, or a particular directory location, is required. These files can't be managed using browser-based Attachment controls.

Uploading Files

  • To upload: Click on the Attach link at the bottom of each page. A form is shown where you can browse for a file and upload it. The uploaded file will show up in the File Attachment table.
    • Files of any type can be uploaded. Some files that might impose a security risk are renamed, ex: *.php files are renamed to *.php.txt.
    • Currently there is no file size limit besides the disk space on the server.
    • The previous upload path is retained for convenience. In case you make some changes to the local file and want to upload it, again you can copy the previous upload path into the Local file field.

Downloading Files

  • NOTE: There is no access control on individual attachments. If you need this type of control, create separate topics and define access restrictions per topic.

Moving Attachment Files

An attachement can be moved between topics. To do this click Action on the attachment to be moved. On the control page, select the new web and topic, the click Move. The attachment and its version history are moved. The original location is stored as topic Meta Data.

Deleting Attachments

It is not possible to delete attached files with the current TWiki implementation. However, they can be moved to another topic. You may care to have a topic Trash.TrashAttachments - move attachments that are no longer wanted here.

Linking to Attached Files

  • To reference an attachment located in another topic, write text:
    • %PUBURL%/%WEB%/OtherTopic/Sample.txt (for the same web)
    • %PUBURL%/Otherweb/OtherTopic/Sample.txt (for adifferent web)

  • Attached HTML files and text files can be inlined in a topic. Example:
    1. Attach file: Sample.txt
    2. Edit topic and write text: %INCLUDE{"%ATTACHURL%/Sample.txt"}%

  • GIF, JPG and PNG images can be attached and shown embedded in a topic. Example:
    1. Attach file: Smile.gif
    2. Edit topic and write text: %ATTACHURL%/Smile.gif
    3. Preview - text appears as Smile.gif, an image.

File Attachment Contents Table

Files attached to a topic are displayed in a directory table, displayed at the bottom of the page, or optionally, hidden and accessed when you click Attach.

Attachment: Action: Size: Date: Who: Comment:
Sample.txt action 30 22 Jul 2000 - 19:37 PeterThoeny Just a sample
Smile.gif action 94 22 Jul 2000 - 19:38 PeterThoeny Smiley face

File Attachment Controls

Clicking on an Action link takes you to a new page that looks like this:

Attachment: Action: Size: Date: Who: Comment: Attribute:
Sample.txt action 30 22 Jul 2000 - 19:37 PeterThoeny Just a sample  
Smile.gif action 94 22 Jul 2000 - 19:38 PeterThoeny Smiley face  

Update attachment Sample.txt

Version: Action: Date: Who: Comment:
1.1 view 2001.08.30.09.28.56 PeterThoeny  

Previous
upload:
C:\DATA\Sample.txt (PeterThoeny)
Local file:
Comment:
Link: Create a link to the attached file at the end of the topic.
Hide file: Hide attachment in normal topic view.
Help text ...

Topic FileAttachment . { | | Move attachment | Cancel }

  • The first table is a list of all attachments, including their attributes. An h means the attachment is hidden, it isn't listed when viewing a topic.

  • The second table is all the versions of the attachment. Click on View to see that version. If it's the most recent version, you'll be taken to an URL that always displays the latest version, which is usually what you want.
    • To change the comment on an attachment, enter a new comment and then click Change properties. Note that the comment listed against the specific version will not change, however the comment displayed when viewing the topic does change.
    • To hide/unhide an attachment, enable the Hide file checkbox, then click Change properties.

Known Issues

  • Unlike topics, attachments are not locked during editing. As a workaround, you can change the comment to indicate an attachment file is being worked on - the comment on the specific version isn't lost, it's there when you list all versions of the attachment.
Line: 46 to 45
Deleted:
<
<

File Attachments

Each topic can have files attached to it, similar to an email attachment. Use your browser to upload or download a file. Attachments are stored under revision control, so uploads can never be lost, and files changes can be made with a rollback option that lets you retrieve all previous versions.

What Are Attachments Good For?

File Attachments can be used to create powerful groupware solutions - file sharing, document management - and for speedy Web authoring.

Document Management System

  • You can use Attachments to store and retrieve documents (in any format, with associated graphics, and other media files); attach documents to specific TWiki topics; collaborate on documents with full revision control; distribute documents on a need-to-know basis using; create a central reference library that's easy to access and manage by an entire user group.

File Sharing

  • For file sharing, FileAttachments on a series of topics can be used to quickly create a well-documented, categorized digital download center for all types of files: documents; graphics and other media; drivers and patches; applications; anything you can safely upload!

Web Authoring

  • Through your Web browser, you can easily upload graphics (or sound files, or anything else you want to embed on a page) and place them anywhere in on a single page, or for use across a web, or site-wide.
    • NOTE: You can also add graphics - any files - directly, typically by FTP upload. This requires server access, and may be more convenient if a large number of files, or a particular directory location, is required. These files can't be managed using browser-based Attachment controls.

Uploading Files

  • To upload: Click on the Attach link at the bottom of each page. A form is shown where you can browse for a file and upload it. The uploaded file will show up in the File Attachment table.
    • Files of any type can be uploaded. Some files that might impose a security risk are renamed, ex: *.php files are renamed to *.php.txt.
    • Currently there is no file size limit besides the disk space on the server.
    • The previous upload path is retained for convenience. In case you make some changes to the local file and want to upload it, again you can copy the previous upload path into the Local file field.

Downloading Files

  • NOTE: There is no access control on individual attachments. If you need this type of control, create separate topics and define access restrictions per topic.

Moving Attachment Files

An attachement can be moved between topics. To do this click Action on the attachment to be moved. On the control page, select the new web and topic, the click Move. The attachment and its version history are moved. The original location is stored as topic Meta Data.

Deleting Attachments

It is not possible to delete attached files with the current TWiki implementation. However, they can be moved to another topic. You may care to have a topic Trash.TrashAttachments - move attachments that are no longer wanted here.

Linking to Attached Files

  • To reference an attachment located in another topic, write text:
    • %PUBURL%/%WEB%/OtherTopic/Sample.txt (for the same web)
    • %PUBURL%/Otherweb/OtherTopic/Sample.txt (for adifferent web)

  • Attached HTML files and text files can be inlined in a topic. Example:
    1. Attach file: Sample.txt
    2. Edit topic and write text: %INCLUDE{"%ATTACHURL%/Sample.txt"}%

  • GIF, JPG and PNG images can be attached and shown embedded in a topic. Example:
    1. Attach file: Smile.gif
    2. Edit topic and write text: %ATTACHURL%/Smile.gif
    3. Preview - text appears as Smile.gif, an image.

File Attachment Contents Table

Files attached to a topic are displayed in a directory table, displayed at the bottom of the page, or optionally, hidden and accessed when you click Attach.

Attachment: Action: Size: Date: Who: Comment:
Sample.txt action 30 22 Jul 2000 - 19:37 PeterThoeny Just a sample
Smile.gif action 94 22 Jul 2000 - 19:38 PeterThoeny Smiley face

File Attachment Controls

Clicking on an Action link takes you to a new page that looks like this:

Attachment: Action: Size: Date: Who: Comment: Attribute:
Sample.txt action 30 22 Jul 2000 - 19:37 PeterThoeny Just a sample  
Smile.gif action 94 22 Jul 2000 - 19:38 PeterThoeny Smiley face  

Update attachment Sample.txt

Version: Action: Date: Who: Comment:
1.1 view 2001.08.30.09.28.56 PeterThoeny  

Previous
upload:
C:\DATA\Sample.txt (PeterThoeny)
Local file:
Comment:
Link: Create a link to the attached file at the end of the topic.
Hide file: Hide attachment in normal topic view.
Help text ...

Topic FileAttachment . { | | Move attachment | Cancel }

  • The first table is a list of all attachments, including their attributes. An h means the attachment is hidden, it isn't listed when viewing a topic.

  • The second table is all the versions of the attachment. Click on View to see that version. If it's the most recent version, you'll be taken to an URL that always displays the latest version, which is usually what you want.
    • To change the comment on an attachment, enter a new comment and then click Change properties. Note that the comment listed against the specific version will not change, however the comment displayed when viewing the topic does change.
    • To hide/unhide an attachment, enable the Hide file checkbox, then click Change properties.

Known Issues

  • Unlike topics, attachments are not locked during editing. As a workaround, you can change the comment to indicate an attachment file is being worked on - the comment on the specific version isn't lost, it's there when you list all versions of the attachment.


Line: 54 to 52
Added:
>
>

TWiki Formatted Search Results

Inline search feature allows flexible formatting of search result

Overview

By default, the format for displaying a search result is fixed, e.g. a table with rows of topic name and topic summary. Use the format="..." parameter to specify a customized format of the search result. The string of the format parameter is typically a bullet list or table row containing variables (i.e. %SEARCH{ "food" format="| $topic | $summary |" }%).

Syntax

Two paramters can be used to specify a customized search result:

1. header="..." parameter

Use the header paramter to specify the header of a search result. It should correspond to the format of the format parameter. This parameter is optional. I.e.
header="| *Topic:* | *Summary:* |"

2. format="..." parameter

Use the format paramter to specify the format of one search hit. I.e.
format="| $topic | $summary |"

Variables that can be used in the format string:

Name: Expands To:
$n New line
$web Name of the web
$topic Topic name
$locked LOCKED flag (if any)
$date Time stamp of last topic update, i.e. 28 Mar 2024 - 10:01
$isodate Time stamp of last topic update, i.e. 2024-03-28T10:01Z
$rev Number of last topic revision, i.e. 1.4
$wikiusername Wiki user name of last topic update, i.e. Main.JohnSmith
$username User name of last topic update, i.e. JohnSmith
$summary Topic summary
$formfield(name) The field value of a form field, i.e. $formfield(TopicClassification) would get expanded to PublicFAQ. This applies only to topics that have a TWikiForm
$pattern(reg-exp) A regular expression pattern to extract some text from a topic, i.e. $pattern(.*?\*.*?Email\:\s*([^\n\r]+).*) extracts the email address from a bullet of format * Email: ....

Note: For $pattern(reg-exp), specify a RegularExpression that scans from start to end and contains the text you want to keep in parenthesis, i.e. $pattern(.*?(from here.*?to here).*). You need to make sure that the integrity of a web page is not compromised, i.e. if you include a table make sure to include everything including the table end tag.

Examples

Bullet list showing topic name and summary

Write this:

%SEARCH{ "FAQ" scope="topic" nosearch="on" nototal="on" header="   * *Topic: Summary:*" format="   * [[$topic]]: $summary" }%

To get this:

  • Topic: Summary:
  • TWikiFAQ: Frequently Asked Questions About TWiki This is a real FAQ, and also a demo of one easily implemented knowledge base solution. See how it's done, click Edit . SEARCH ...
  • TWikiFaqTemplate: FAQ: Answer: Back to: NOP TWikiFAQ WIKIUSERNAME DATE
  • TextFormattingFAQ: Text Formatting FAQ The most frequently asked questions about text formatting are answered. Also, TextFormattingRules contains the complete TWiki shorthand system ...

Table showing form field values of topics with a form

Write this in the Know web:

| *Topic:* | *OperatingSystem:* | *OsVersion:* |
%SEARCH{ "[T]opicClassification.*?value=\"[P]ublicFAQ\"" scope="text" regex="on" nosearch="on" nototal="on" format="| [[$topic]] | $formfield(OperatingSystem) | $formfield(OsVersion) |" }%

To get this:

Topic: OperatingSystem: OsVersion:
IncorrectDllVersionW32PTH10DLL OsWin 95/98
WinDoze95Crash OsWin 95

Extract some text from a topic using regular expression

Write this:

%SEARCH{ "__Back to\:__ TWikiFAQ" scope="text" regex="on" nosearch="on" nototal="on" header="TWiki FAQs:" format="   * $pattern(.*?FAQ\:[\n\r]*([^\n\r]+).*) [[$topic][Answer...]]" }%

To get this:

TWiki FAQs:

  • How do I delete or rename a topic? Answer...
  • Why does the topic revision not increase when I edit a topic? Answer...
  • TWiki has a GPL (GNU General Public License). What is GPL? Answer...
  • I've problems with the WebSearch. There is no Search Result on any inquiry. By clicking the Index topic it's the same problem. Answer...
  • What happens if two of us try to edit the same topic simultaneously? Answer...
  • I would like to install TWiki on my server. Can I get the source? Answer...
  • So what is this WikiWiki thing exactly? Answer...
  • Everybody can edit any page, this is scary. Doesn't that lead to chaos? Answer...

-- PeterThoeny? - 28 Nov 2001


TWiki Meta Data

Additional topic data, program-generated or from TWikiForms, is stored in META variable name/value pairs

Overview

TWikiMetaData uses META variables to store topic data that's separate from the main free-form content. This includes program-generated info like FileAttachment and topic movement data, and user-defined TWikiForms info. Use META variables to format and display Meta Data.

Meta Data Syntax

  • Format is the same as in TWikiVariables, except all fields have a key.
    • %META:<type>{key1="value1" key2="value2" ...}%

  • Order of fields within the meta variables is not defined, except that if there is a field with key name, this appears first for easier searching (note the order of the variables themselves is defined).

  • Each meta variable is on one line.

  • \n (new line) is represented in values by %_N_ and " (double-quotes) by %_Q_%.

Example of Format
%META:TOPICINFO{version="1.6" date="976762663" author="PeterThoeny" format="1.0"}%
   text of the topic
%META:TOPICMOVED{from="Codev.OldName" to="Codev.NewName"
   by="JohnTalintyre" date="976762680"}%
%META:TOPICPARENT{name="NavigationByTopicContext"}%
%META:FILEATTACHMENT{name="Sample.txt" version="1.3" ... }%
%META:FILEATTACHMENT{name="Smile.gif" version="1.1" ... }%
%META:FORM{name="WebFormTemplate"}%
%META:FIELD{name="OperatingSystem" value="OsWin"}%
%META:FIELD{name="TopicClassification" value="PublicFAQ"}%

Meta Data Specifications

The current version of Meta Data is 1.0, with support for the following variables.

META:TOPICINFO

Key Comment
version Same as RCS version
date integer, unx time, seconds since start 1970
author last to change topic, is the REMOTE_USER
format Format of this topic, will be used for automatic format conversion

META:TOPICMOVED

This is optional, exists if topic has ever been moved. If a topic is moved more than once, only the most recent META:TOPICMOVED meta variable exists in the topic, older ones are to be found in the rcs history.

%META:TOPICMOVED{from="Codev.OldName" to="Codev.NewName" by="talintj" date="976762680"}%

Key Comment
from Full name i.e. web.topic
to Full name i.e. web.topic
by Who did it, is the REMOTE_USER, not WikiName
date integer, unx time, seconds since start 1970

Notes:

  • at present version number is not supported directly, it can be inferred from the RCS history.
  • there is only one META:TOPICMOVED in a topic, older move information can be found in the RCS history.

META:TOPICPARENT

Key Comment
name The topic from which this was created, WebHome if done from Go, othewise topic where ? or form used. Normally just topic, but is full web.topic format if parent is in a different Web. Renaming a Web will then only break a few of these references or they can be scanned and fixed.

META:FILEATTACHMENT

Key Comment
name Name of file, no path. Must be unique within topic
version Same as RCS revision
path Full path file was loaded from
size In bytes
date integer, unx time, seconds since start 1970
user the REMOTE_USER, not WikiName
comment As supplied when file uploaded
attr h if hidden, optional

Extra fields that are added if an attachment is moved:

Key Comment
movedfrom full topic name - web.topic
movedby the REMOTE_USER, not WikiName
movedto full topic name - web.topic
moveddate integer, unx time, seconds since start 1970

META:FORM

Key Comment
name A topic name - the topic represents one of the TWikiForms. Can optionally include the web name i.e. web.topic, but doesn't normally

META:FIELD

Should only be present if there is a META:FORM entry. Note that this data is used when viewing a topic, the form template definition is not read.

Key Name
name Ties to entry in TWikiForms template, is title with all bar alphanumerics and . removed
title Full text from TWikiForms template
value Value user has supplied via form

Recommended Sequence

There is no absolute need for Meta Data variables to be listed in a specific order within a topic, but it makes sense to do so a couple of good reasons:

  • form fields remain in the order they are defined
  • the diff function output appears in a logical order

The recommended sequence is:

  • META:TOPICINFO
  • text of topic
  • META:TOPICMOVED (optional)
  • META:TOPICPARENT (optional)
  • META:FILEATTACHMENT (0 or more entries)
  • META:FORM (optional)
  • META:FIELD (0 or more entries; FORM required)

Viewing Meta Data in Page Source

When viewing a topic the Raw Text link can be clicked to show the text of a topic (ie: as seen when editing). This is done by adding raw=on to URL. raw=debug shows the meta data as well as the topic data, ex: debug view for this topic

Rendering Meta Data

Meta Data is rendered with the %META% variable. This is mostly used in the view, preview and edit scripts.

Current support covers:

Variable usage: Comment:
%META{"form"}% Show form data, see TWikiForms
%META{"attachments"}% Show attachments, exclude hidden
Options for Attachments:  
all="on" Show ALL attachments (including hidden)
%META{"moved"}% Details of any topic moves
%META{"parent [options]"}% Show topic parent
Options for parent:  
dontrecurse="on" By default recurses up tree, at some cost
prefix="..." Prefix for parents, only if there are parents; default ""
suffix="..." Suffix, only appears if there are parents; default ""
separator="..." Separator between parents, default is " > "

Known Issues

At present, there is no Meta Data support for Plugins. However, the format is readily extendable and the Meta.pm code that supports the format needs only minor alteration.

-- JohnTalintyre - 29 Aug 2001
-- MikeMannix - 03 Dec 2001


Line: 70 to 72
Deleted:
<
<

TWiki Meta Data

Additional topic data, program-generated or from TWikiForms, is stored in META variable name/value pairs

Overview

TWikiMetaData uses META variables to store topic data that's separate from the main free-form content. This includes program-generated info like FileAttachment and topic movement data, and user-defined TWikiForms info. Use META variables to format and display Meta Data.

Meta Data Syntax

  • Format is the same as in TWikiVariables, except all fields have a key.
    • %META:<type>{key1="value1" key2="value2" ...}%

  • Order of fields within the meta variables is not defined, except that if there is a field with key name, this appears first for easier searching (note the order of the variables themselves is defined).

  • Each meta variable is on one line.

  • \n (new line) is represented in values by %_N_ and " (double-quotes) by %_Q_%.

Example of Format
%META:TOPICINFO{version="1.6" date="976762663" author="PeterThoeny" format="1.0"}%
   text of the topic
%META:TOPICMOVED{from="Codev.OldName" to="Codev.NewName"
   by="JohnTalintyre" date="976762680"}%
%META:TOPICPARENT{name="NavigationByTopicContext"}%
%META:FILEATTACHMENT{name="Sample.txt" version="1.3" ... }%
%META:FILEATTACHMENT{name="Smile.gif" version="1.1" ... }%
%META:FORM{name="WebFormTemplate"}%
%META:FIELD{name="OperatingSystem" value="OsWin"}%
%META:FIELD{name="TopicClassification" value="PublicFAQ"}%

Meta Data Specifications

The current version of Meta Data is 1.0, with support for the following variables.

META:TOPICINFO

Key Comment
version Same as RCS version
date integer, unx time, seconds since start 1970
author last to change topic, is the REMOTE_USER
format Format of this topic, will be used for automatic format conversion

META:TOPICMOVED

This is optional, exists if topic has ever been moved. If a topic is moved more than once, only the most recent META:TOPICMOVED meta variable exists in the topic, older ones are to be found in the rcs history.

%META:TOPICMOVED{from="Codev.OldName" to="Codev.NewName" by="talintj" date="976762680"}%

Key Comment
from Full name i.e. web.topic
to Full name i.e. web.topic
by Who did it, is the REMOTE_USER, not WikiName
date integer, unx time, seconds since start 1970

Notes:

  • at present version number is not supported directly, it can be inferred from the RCS history.
  • there is only one META:TOPICMOVED in a topic, older move information can be found in the RCS history.

META:TOPICPARENT

Key Comment
name The topic from which this was created, WebHome if done from Go, othewise topic where ? or form used. Normally just topic, but is full web.topic format if parent is in a different Web. Renaming a Web will then only break a few of these references or they can be scanned and fixed.

META:FILEATTACHMENT

Key Comment
name Name of file, no path. Must be unique within topic
version Same as RCS revision
path Full path file was loaded from
size In bytes
date integer, unx time, seconds since start 1970
user the REMOTE_USER, not WikiName
comment As supplied when file uploaded
attr h if hidden, optional

Extra fields that are added if an attachment is moved:

Key Comment
movedfrom full topic name - web.topic
movedby the REMOTE_USER, not WikiName
movedto full topic name - web.topic
moveddate integer, unx time, seconds since start 1970

META:FORM

Key Comment
name A topic name - the topic represents one of the TWikiForms. Can optionally include the web name i.e. web.topic, but doesn't normally

META:FIELD

Should only be present if there is a META:FORM entry. Note that this data is used when viewing a topic, the form template definition is not read.

Key Name
name Ties to entry in TWikiForms template, is title with all bar alphanumerics and . removed
title Full text from TWikiForms template
value Value user has supplied via form

Recommended Sequence

There is no absolute need for Meta Data variables to be listed in a specific order within a topic, but it makes sense to do so a couple of good reasons:

  • form fields remain in the order they are defined
  • the diff function output appears in a logical order

The recommended sequence is:

  • META:TOPICINFO
  • text of topic
  • META:TOPICMOVED (optional)
  • META:TOPICPARENT (optional)
  • META:FILEATTACHMENT (0 or more entries)
  • META:FORM (optional)
  • META:FIELD (0 or more entries; FORM required)

Viewing Meta Data in Page Source

When viewing a topic the Raw Text link can be clicked to show the text of a topic (ie: as seen when editing). This is done by adding raw=on to URL. raw=debug shows the meta data as well as the topic data, ex: debug view for this topic

Rendering Meta Data

Meta Data is rendered with the %META% variable. This is mostly used in the view, preview and edit scripts.

Current support covers:

Variable usage: Comment:
%META{"form"}% Show form data, see TWikiForms
%META{"attachments"}% Show attachments, exclude hidden
Options for Attachments:  
all="on" Show ALL attachments (including hidden)
%META{"moved"}% Details of any topic moves
%META{"parent [options]"}% Show topic parent
Options for parent:  
dontrecurse="on" By default recurses up tree, at some cost
prefix="..." Prefix for parents, only if there are parents; default ""
suffix="..." Suffix, only appears if there are parents; default ""
separator="..." Separator between parents, default is " > "

Known Issues

At present, there is no Meta Data support for Plugins. However, the format is readily extendable and the Meta.pm code that supports the format needs only minor alteration.

-- JohnTalintyre - 29 Aug 2001
-- MikeMannix - 03 Dec 2001



Topic TWikiDocumentation . { View | Diffs | r1.39 | > | r1.38 | > | r1.37 | More }    output as: { }
Revision r1.38 - 03 Dec 2001 - 06:43 - MikeMannix?
Revision r1.39 - 03 Dec 2001 - 12:38 - MikeMannix?