Export Templates [Linkman Pro only]
Export Templates are useful if you want to export your Bookmark collection in a format that Linkman does not support directly. 7 Template examples are already included - 5 HTML, one TSV (Tab Separated Values) and one XML template.
To test the Template functionality go to the File | Export | Template menu or use the button menu and select one of the Templates from the submenu.
A save dialog will pop up and after you type in the name Linkman will save the active Treeview in the selected format.
On the screenshot below you can see the output of Html Example Template 4 in Internet Explorer:
Linkman can automatically save a template file when saving a lmd file (configure in Tools | Settings | Data).
How to create a Template?
With this example you will create a CSV (Comma Separated Values) Template that is not included with Linkman.
You can show the Linkman Export Templates window by selecting File | Export | Edit Export Templates or clicking on the button.
A window will pop up - you will see a small Button bar and a List View containing the 6 example Templates.
To create a new Template click on the New Template... button.
After you enter my first template as name the Template Editor window will show.
You will see 6 different pages - the first page is for description and configuration purposes, the remaining 5 pages contain the Template code.
When Linkman saves a template it processes the code from Header page, following by the other pages, the Footer page will be processed as last.
1.
You should now describe and configure the Template.
replace the Linkman Export Template text with some other text like This is my first template description.
change
Default Extension=
to
Default Extension=csv
with this change Linkman will use this extension for the files exported with this template.
2.
Activate the Header page.
enter the following text (without the snip lines):
---------------------------------- snip ----------------------------------
Name;Path;Comment;Rating
---------------------------------- snip ----------------------------------
since this is the Header, Linkman will add this text to the top of the exported file.
3.
Activate the Main Body : First Pass page.
Select Folder from the combo box.
enter the following text (without the snip lines):
---------------------------------- snip ----------------------------------
<FOLDER.NAME>,,<FOLDER.COMMENT>,<FOLDER.KEYWORDS>,<FOLDER.RATING>
---------------------------------- snip ----------------------------------
<FOLDER.NAME> is a so called Linkman Tag. When saving the template Linkman will replace this Tag with the actual name of every processed folder. You can add additional Tags like Time and Date or the User defined data in the Add Linkman Tag menu.
4.
Select Bookmark from the combo box.
enter the following text into the every Bookmark section:
<Bookmark.NAME>,<Bookmark.PATH>,<Bookmark.COMMENT>,<Bookmark.KEYWORDS>,<Bookmark.RATING>
Linkman will process this code with every Bookmark in the Tree and replace the tags with the data - e.g. <Bookmark.PATH> will be replaced with the content of the Bookmark path.
Now close the window - Linkman will ask you whether to save the changes or not - answer with Yes.
You have successfully created your first Template - you can try it out immediately!
To learn more about Export Templates study the code of the 5 included Html Templates.
Internal Html
You can also create a template from the Internal Html Output settings. (Tools menu). The internal Html Output can be configured in Linkman's settings dialog. (Tools | Settings | Html Output).
Description-section tags
Separate file for every root folder checkbox
When checked Linkman will not save to one file, but create multiple template files. A separate file will be created for every root folder (filename will consist of folder name + default extension).
Default Extension
This extension will be used in the file dialog and for the template written with a lmd file (see Tools | Settings | Data in main menu).
Default Path
Default path for the file dialog.
Default Filename
This filename will be used in the file dialog and for the template written with a lmd file (see Tools | Settings | Data in main menu).
ResetUrlCounter/ResetChildFolderCounter
These settings are related to the Main Body | Bookmark | Every .. Bookmarks section and Main Body | Child Folder | Every .. folders sections. If set to Yes Linkman will reset the counters to 0 on the beginning of every folder/root folder.
Format
You can create not only Latin1, but also UTF-8 templates.
Add this line to the template description page:
Format=UTF-8
and all text will be converted to UTF-8.
The included XML example template generates UTF-8 text.
Linefeeds
If set to No Linkman will convert all linefeeds to <br> tags.
DateTimes
If set to Yes Bookmark Dates will be saved as Date + Time, if set to No only Dates will be saved.
CommentsToDescription
If set to Yes <Bookmark.DESCRIPTION> will be replaced with Comments if the Description data field of the Bookmark is empty.