1
%META:TOPICINFO{author="ProjectContributor" date="1231502400" format="1.1" version="1"}%
6
_Additional topic data, program-generated or from DataForms, is stored embedded in the topic text using =META:= tags_
12
By default, topics are stored in files on disk, in a really simple and obvious directory structure. The big advantage of this approach is that it makes it really easy to manipulate topics from outside, and is also very safe; there are no complex binary indexes to maintain, and moving a topic from one installation to another is as simple as copying a couple of text files.
14
To keep eveything together in one place, meta-data (program-generated or from DataForms) is embedded directly in topics. It does this using =META:= tags.
16
=META:= data includes program-generated info like FileAttachment, topic movement data and user-defined information from DataForms.
18
---++ Meta data syntax
20
* Format is the same as in [[%SYSTEMWEB%.Macros][macros]], except all fields have a key.
21
* =%<nop>META:<type>{key1="value1" key2="value2" ...}%=
23
* Order of fields within the meta-data is not defined, except that if there is a field with key =name=, this appears first for easier searching (note the order of the data themselves is defined).
25
* Each meta-datum is on one line.
27
* Values in meta-data are URL encoded so that characters such as \n can be stored.
32
%<nop>META:TOPICINFO{version="1.6" date="976762663" author="LastEditorWikiName" format="1.0"}%
34
%<nop>META:TOPICMOVED{from="Codev.OldName" to="Codev.NewName"
35
by="TopicMoverWikiName" date="976762680"}%
36
%<nop>META:TOPICPARENT{name="NavigationByTopicContext"}%
37
%<nop>META:FILEATTACHMENT{name="Sample.txt" version="1.3" ... }%
38
%<nop>META:FILEATTACHMENT{name="Smile.gif" version="1.1" ... }%
39
%<nop>META:FORM{name="WebFormTemplate"}%
40
%<nop>META:FIELD{name="OperatingSystem" value="OsWin"}%
41
%<nop>META:FIELD{name="TopicClassification" value="PublicFAQ"}%
45
---++ Meta data specifications
47
The current version of Meta Data is 1.0, with support for the following syntax.
52
| version | Same as SVN version |
53
| date | integer, unix time, seconds since start 1970 |
54
| author | last to change topic, is the REMOTE_USER |
55
| format | Format of this topic, will be used for automatic format conversion |
57
---+++ META:TOPICMOVED
59
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 datum exists in the topic, older ones are to be found in the rcs history.
61
=%<nop>META:TOPICMOVED{from="Codev.OldName" to="Codev.NewName" by="talintj" date="976762680"}%=
64
| from | Full name, i.e., web.topic |
65
| to | Full name, i.e., web.topic |
66
| by | Who did it, is the REMOTE_USER, not <nop>WikiName |
67
| date | integer, unix time, seconds since start 1970 |
70
* at present version number is not supported directly, it can be inferred from the SVN history.
71
* there is only one META:TOPICMOVED in a topic, older move information can be found in the SVN history.
73
---+++ META:TOPICPARENT
76
| name | The topic from which this was created, typically when clicking on a =?= questionmark link, or by filling out a form. Normally just =TopicName=, but it can be a full =Web.TopicName= format if the parent is in a different Web. |
78
---+++ META:FILEATTACHMENT
81
| name | Name of file, no path. Must be unique within topic |
82
| version | Same as SVN revision |
83
| path | Full path file was loaded from |
85
| date | integer, unix time, seconds since start 1970 |
86
| user | the REMOTE_USER, not <nop>WikiName |
87
| comment | As supplied when file uploaded |
88
| attr | =h= if hidden, optional |
90
Extra fields that are added if an attachment is moved:
93
| movedfrom | full topic name - web.topic |
94
| movedby | the REMOTE_USER, not <nop>WikiName |
95
| movedto | full topic name - web.topic |
96
| moveddate | integer, unix time, seconds since start 1970 |
100
| *Key* | *Comment* |
101
| name | A topic name - the topic represents one of the DataForms. Can optionally include the web name (i.e., web.topic), but doesn't normally |
105
Should only be present if there is a META:FORM entry. Note that this data is used when viewing a topic; the form definition is not read.
108
| name | Ties to entry in DataForms template, is title with all bar alphanumerics and . removed |
109
| title | Full text from DataForms template |
110
| value | Value user has supplied via form |
112
---+++ Recommended sequence
114
There is no absolute need for Meta data to be listed in a specific order within a topic, but it makes sense to do so for a couple of good reasons:
116
* form fields remain in the order they are defined
117
* the =diff= function output appears in a logical order
119
The recommended sequence is:
122
* =META:TOPICPARENT= (optional)
124
* =META:TOPICMOVED= (optional)
125
* =META:FILEATTACHMENT= (0 or more entries)
126
* =META:FORM= (optional)
127
* =META:FIELD= (0 or more entries; FORM required)
129
---++ Viewing meta data in page source
131
When viewing a topic the ==[View raw text]== link can be clicked to show the text of a topic (i.e., as seen when editing). This is done by adding <code>raw=on</code> to URL. <code>raw=debug</code> shows the meta data as well as the topic data, ex: <a href="%SCRIPTURLPATH{"view"}%/%WEB%/%TOPIC%?raw=debug">debug view for this topic</a>
134
---++ Rendering meta data
136
Meta data is rendered with the %<nop>META% macro. This is mostly used in the =view=, =preview= and =edit= scripts.
138
You can render form fields in topic text by using the FORMFIELD macro. Example:%BR%
139
=%<nop>FORMFIELD{"TopicClassification"}%= %BR%
140
For details, see VarFORMFIELD.
142
Current support covers:
144
| *Macro usage:* | *Comment:* |
145
| =%<nop>META{"form"}%= | Show form data, see DataForms. |
146
| =%<nop>META{"formfield"}%= | Show form field value. Parameter: ==name="field_name"==. Example:%BR% =%<nop>META{ "formfield" name="TopicClassification" }%= |
147
| =%<nop>META{"attachments"}%= | Show attachments, except for hidden ones. Options: <br /> \
148
==all="on"==: Show all attachments, including hidden ones. |
149
| =%<nop>META{"moved"}%= | Details of any topic moves. |
150
| =%<nop>META{"parent"}%= | Show topic parent. Options: <br /> \
151
==dontrecurse="on"==: By default recurses up tree, at some cost. <br /> \
152
==nowebhome="on"==: Suppress <nop>%HOMETOPIC%. <br /> \
153
==prefix="..."==: Prefix for parents, only if there are parents, default =""=. <br /> \
154
==suffix="..."==: Suffix, only appears if there are parents, default =""=. <br /> \
155
==separator="..."==: Separator between parents, default is =" > "=. |
157
%H% SEARCH can also be used to render meta data, see examples in FormattedSearch and SearchPatternCookbook.
160
*Related Topics:* DeveloperDocumentationCategory, UserDocumentationCategory