The URL format for non-Bible links is:
Code: Select all
tw://bible|cmt|dct|bk|book|map|media.[module-id]?[parameters]#[anchor]
The [parameters] use the standard [name=value] format.
Supported parameters:
- t: refers to a topic subject
- tid: refers to the internal topic id (the id in the database of the topics table - you can get this value from within TW).
- [anchor] is an anchor point within the text itself (a bookmark if you like). In RTF, the bookmarks are defined with {\*\bkmkstart [ANCHOR]}{\*\bkmkend [ANCHOR]}. This is similar to html anchor points defined with #. Notice, that the [ANCHOR] should start with # if there is nothing else in the URL (see below examples)
Examples:
- tw://dct.webster?t=Aaron -> links to the Webster dictionary to topic ‘Aaron’. Can be written also as tw://dct.webster.dct?t=Aaron (either webster or webster.dct are OK)
- #bookmark1: in case of anchors, the whole ‘tw://…’ can be ommted and only the name of the anchor bookmark can be given. For compatibility with other readers (MS Word, etc) the bookmark name should start with a letter and contain only letters and digits.
- tw://dct.mydct?tid=1#b3 -> this is a link to a dictionary name ‘mydct’, to the topic id 1 (this is the id of the internal table 'topics') and to the bookmark in document named 'b3'.
Difference between tid and t parameters in URLs
There are 2 ways to define a link to a topic: the tid and the t parameter. Both have advantages and disadvantages.
The t parameter is used with the actual topic subject as it’s value (e.g. t=Aaron). If the topic subject changes (is updated), then the link will no longer be valid. In these cases (especially when the subject is changed from within the program), the id remains the same.
The tid parameter uses the internal id of the actual topic (the one in the 'topics' table). This only change in cases the topic is deleted. This is the safest way to make links, but there is the disadvantage that you need to know this internal id. TW provides a way to find this id from within the program itself.
Here is an example RTF that defines a bookmark (anchor point) within the document in one place, and also defines in another place a link to that bookmark. Clicking on this link will make the document 'jump' to the bookmark position:
Code: Select all
This is some text. Here follows a link to another part in the document: {\field{\*\fldinst HYPERLINK #b1}{\fldrslt Click me}}.
\par\par\par\par\par\par\par\par\par
This is the target of the above link. Once you click on the 'Click me' link, the viewer will jump to the following line:
{\*\bkmkstart b1}{\*\bkmkend b1}Here is the anchor!
\par
Hope this helps!
Costas