FIW template system - tag description

This is a short introduction for the different template tags that are supported by FIW since version 0.06.

You may use these template tags within your HTML-documents to reduce the amount of work you have to do when releasing a new edition of your site or when you do not want to hardcode some portions of your documents (such as public key or edition number) over and over again, resulting in a hunt when you want to change them.

This document is compatible to Freesite Insertion Wizard version 0.06 and 0.07.

Supported Tags:

preinitialized project settings tags provided by FIW:

First we start with some screenshots taken from a running FIW to show you which values from the wizard can be used as a tag within your freesite and where to find them within the user interface of FIW.


screenshot 1


screenshot 2


screenshot 3

As you can see we have prepared the values of the input fields so you can easily identify them with the template tags.

tag description screenshot's value
#$#ps.projname; FIW's name for the project. (found within screenshot 1)
Sample Project
#$#ps.ednum; Edition number from your project's settings (unformatted). (found within screenshot 3)
123
#$#ps.pubkey; Public SSK from your project's settings. (found within screenshot 1)
xPKwab~2VvOLuikZJrDWw-b2M20
#$#ps.privkey; Private SSK from your project's settings
Note: This tag is disabled for security reasons. If you want to enable it, please uncomment the corresponding code lines in HTMLParser.java (search for "ps.privkey").
(found within screenshot 1)
CtEeGiY~-k7LzOBPjZUEhcSSwHY
#$#ps.keydir; The key directory the site is uploaded to. (found within screenshot 1)
samplepage
#$#ps.key; Public URI from your project's settings. (same as "/SSK@#$#ps.pubkey;PAgM/#$#ps.keydir;" or "/#$#ps.keynoslash;")*
/SSK@xPKwab~2VvOLuikZJrDWw-b2M20PAgM/samplepage
#$#ps.keynoslash; Public URI from your project's settings, without leading slash. (FIW 0.07 and above) (same as "SSK@#$#ps.pubkey;PAgM/#$#ps.keydir;")*
SSK@xPKwab~2VvOLuikZJrDWw-b2M20PAgM/samplepage
#$#ps.keyonly; Public SSK with heading /SSK@ and tailing PAgM* for easy use of the public key. (same as "/SSK@#$#ps.pubkey;PAgM")*
/SSK@xPKwab~2VvOLuikZJrDWw-b2M20PAgM
#$#ps.actlink; ActiveLink from your project's settings. (found within screenshot 2)
activelink.gif
#$#ps.nimpref; NIM prefix from your project's settings. (found within screenshot 2)
samplenim
#$#ps.nextnim; Next free NIM slot from your project's settings. (found within screenshot 2)
321

*: PAgM is freenet specific. Please try to avoid creating sites containing links with this hardcoded value and use the corresponding tags provided by FIW. Other platforms, such as Entropy, use a different string and also future freenet versions might alter this, too. Freenet SSK keys with entropy might produce a different string also. Let your insertion tool decide the key format to use!

arithmetic tags:

tag description example result
#$#number; Returns the number itself. #$#66; 66
#$#tag1+tag2[+tag3[+...]]; The sum of all the numbers the tags give. #$#ps.ednum+ps.ednum+5; The current edition number times 2 plus 5.

processing tags:

tag description example result
#$#e:tag; Format the result of tag as an edition number (same as #$#ps.ednum if no special edition number). #$#e:ps.ednum+1; The current edition number plus 1 (formatted).
#$#date:format; Inserts current GMT date and time in given format.
If format is empty, "EEEE, yyyy-MM-dd HH:mm:ss" is used.
For RFC compliant dates, use "EEE, dd MMM yyyy HH:mm:ss ZZZZ". Please consult java.text.SimpleDateFormat for more information on format.
#$#date:; Thursday, 2003-03-20 10:36:42

importing tags:

tag description example result
#$#url:url; This inserts the content of an URL (allows a very easy method for mirroring web sites or local files with file://...;). #$#url:http://www.gmx.net/index.html; <HTML>...content...</HTML>
#$#file:filename; Inserts a local file (located in __fiw/include or .fiw/include). #$#file:somefile.txt; Content of the file specified.

entity tags:

tag description example result
#$## The textstring #$#. #$## #$#

defining tags:

tag description example result
#$#def:tag; Following text (re)defines tag. #$#def:foo;blafasel... The tag foo is (re)defined, beginning with blafasel until the template tag #$#def:end; is found.
#$#def:end; Following text is for the document (end of definition). abcde#$#def:end;fghij abcde belongs to a former tag definition, fghij does not belong to it anymore.
#$#def:add:tag; Following text defines tag, if that one is not defined yet.
If the tag is already defined, all text between this tag and #$#def:end is ignored.
#$#def:add:bar;blafasel... The tag bar is defined if it is not defined, beginning with blafasel until the template tag #$#def:end; is found.

S.C.U.M. description tags (these are supported only by FIW version 0.07 and above):

Again a screenshot for your viewing pleasure. This time we'll examine the description tags.


screenshot 4

tag description screenshot's value
#$#tags.title; The title you gave the freesite on the tags settings page. (found within screenshot 4)
My new freesite
#$#tags.category; The category you gave the freesite on the tags settings page. (found within screenshot 4)
Software
#$#tags.author; The author you gave for the freesite on the tags settings page. (found within screenshot 4)
anonymous
#$#tags.description; The contents of your description.txt. (found within screenshot 4)
brief site description

Snipplets:

Here is a collection of the mostly used tags. It is intended for you to copy and paste it into one of your document files to see the tags' current values, so you can check if all the values are correct and which of them are useful for you.

<BR>
#$##date:; = #$#date:;<BR>
<BR>
#$##tags.title; = #$#tags.title;<BR>
#$##tags.category; = #$#tags.category;<BR>
#$##tags.author; = #$#tags.author;<BR>
#$##tags.description; = #$#tags.description;<BR>
<BR>
#$##ps.projname; = #$#ps.projname;<BR>
#$##ps.ednum; = #$#ps.ednum;<BR>
#$##ps.pubkey; = #$#ps.pubkey;<BR>
#$##ps.keydir; = #$#ps.keydir;<BR>
#$##ps.key; = #$#ps.key;<BR>
#$##ps.keyonly; = #$#ps.keyonly;<BR>
#$##ps.actlink; = #$#ps.actlink;<BR>
#$##ps.nimpref; = #$#ps.nimpref;<BR>
#$##ps.nextnim; = #$#ps.nextnim;<BR>
<BR>

Complete S.C.U.M. description headers for copy'n'paste, select the one according to your freesite type.
Please consult A Freesite Indexing System Using Page Tags for detailed information. (Freenet must be running on your local computer for this link to work and the author of TFEE must not have changed TFEE's site manifest. Otherwise you might use the local copy from 24.05.2003)

edition sites:

<!--index
<title>#$#tags.title;</title>
<category>#$#tags.category;</category>
<description>#$#tags.description;</description>
<activelink>#$#ps.keynoslash;/#$#e:ps.ednum;//#$#ps.actlink;</activelink>
<site address>#$#ps.keynoslash;/#$#e:ps.ednum;//</site address>
<address type>edition</address type>
<edition number>#$#e:ps.ednum;</edition number>
<next edition>#$#ps.keynoslash;/#$#e:ps.ednum+1;//</next edition>
<author>#$#tags.author;</author>
<date>#$#date:EEEEEEEE,MMMMMMMM dd,yyyy;</date>
<no indexing>no</no indexing>
-->

DBR sites:

<!--index
<title>#$#tags.title;</title>
<category>#$#tags.category;</category>
<description>#$#tags.description;</description>
<activelink>#$#ps.keynoslash;//#$#ps.actlink;</activelink>
<site address>#$#ps.keynoslash;//</site address>
<address type>DBR</address type>
<author>#$#tags.author;</author>
<date>#$#date:EEEEEEEE,MMMMMMMM dd,yyyy;</date>
<no indexing>no</no indexing>
-->

one shot sites:

<!--index
<title>#$#tags.title;</title>
<category>#$#tags.category;</category>
<description>#$#tags.description;</description>
<activelink>#$#ps.keynoslash;//#$#ps.actlink;</activelink>
<site address>#$#ps.keynoslash;//</site address>
<address type>one shot</address type>
<author>#$#tags.author;</author>
<date>#$#date:EEEEEEEE,MMMMMMMM dd,yyyy;</date>
<no indexing>no</no indexing>
-->

Last Words:

Please have a look at the file templates.html found within you FIW installation directory which will provide some more information and example templates for your reference and usage.

Credits:

FIW template tag system - mihi.
This document - 334.

Changelog:

20030322:
- first version, released bundled with FIW 0.06
20030818:
- bundled with FIW 0.07
- screenshots size optimized by Max M. S.
- added comment on the PAgM key string
- added S.C.U.M. description tags