About templates

What are templates?

Templates are small bundles of files that SiteTagger can use when exporting bookmarks as HTML. SiteTagger comes with several templates pre-installed but more can be downloaded. Templates can be added by double-clicking them in the Finder, clicking the “+” button in the Templates preferences pane and selecting them, or dragging them to ~/Library/SiteTagger/Templates/.

Templates can be selected from SiteTagger’s preferences. When you open the Templates preference pane, there is a scroll view that shows icon representations of the available templates. Simply click on the one you like and SiteTagger will use that template the next time you export bookmarks as HTML.

Creating your own templates

Templates are packages of standard HTML and CSS files. Templates have a requirement of at least three files: an HTML file, an image, and an Info.plist file.

When SiteTagger exports, it uses the HTML file as a template. It uses two keys. The first is “tags”. SiteTagger will replace this key with an unordered list (<ul>) containing all of the tags. The second is “bookmarks”. SiteTagger will replace this key with bookmarks in the mBookmark microformat. You can style the HTML file using CSS. Any additional files should be stored in the same folder as the HTML file.

The image file is a 100x100 pixel image in a standard image format (PNG, GIF, JPEG, TIFF, and others) that will represent your icon in the template chooser. Customarily, there is a 1px black border around the image although this is not required.

The Info.plist file holds the template together. It informs SiteTagger about which file is the designated template HTML file and which is the icon file. It also stores other information such as author’s name, email, and website.

Templates can be put together easily using SiteTagger’s built-in Template Bundler. The Bundler will take a folder of files and turn it into a usable SiteTagger template. The Template Bundler is accessible via a hidden preference. To show the Template Bundler, open the Terminal and type:

defaults write com.fcs.SiteTagger ShowTemplateBundlerButton -bool yes

A “Bundle template” button will now be visible in the Template preference pane. You can hide the button again by repeating the above line and using no instead of yes.

To bundle a template, click on the “Choose folder…” button and select the folder containing the files necessary for creating a template. Enter the information requested by SiteTagger. The file name must include file extension and may be paths relative to the folder (for instance, an icon file called “Icon.png” located in the “images” folder of the template folder can be accessed by putting “images/Icon.png” into the icon file name box). When all of the information is entered, click on the “Bundle” button. SiteTagger will copy the contents of the directory into a template file and write out the necessary Info.plist file.