Last edit 1st June 2018 by Jon
This post only applies to setting up your new template or style. Other publishing FAQs detail how the content can be customised.
The recommended location for the modified templates is:- Users\Public\Documents\Sailwave\Templates this is configured in the Setup – Global options – Folders
Copy the template you wish to modify from the installation templates folder to your new folder. The Sailwave templates all reference header.txt and footer.txt, so you’ll need to also copy these (and subsequently edit as needed) – or – paste the content of them into your new template where they are referenced.
Depending on your operating system, your installation templates folder will be one of:-
C:\Program Files (x86)\Sailwave\templates
Open Sailwave. Open the global options (setup+global options menu). Click the Folders tab and point the My template files field to your new folder. In later versions, this is pre-configured for you. You can either type it in or use the little wave icon to select it. Close Sailwave.
On Italian PC’s the Italian versions of the Templates are pre-installed in C:\Users\Public\Documents\Sailwave\Templates\ITA
When there is a template of the same file name in the default folder and your own folder, Sailwave uses your version. So this template will now be used. If your template has a different file name to any of the factory templates, it is added to the publishing list instead of replacing an existing item in the publishing list.
Templates contain HTML and callbacks to Sailwave using backquotes `. For example:-
You can control how the template looks in the Sailwave publishing menu using these callbacks:-
setmenurank controls where the template is displayed in the publishing menu. Have a look at the factory templates to see what values they use and choose your values appropriately. The factory templates use large gaps and start at 100, so you can easily intersperse your own templates. The lower the value the more towards the top of the menu.
setmenutext specifies the menu text. Use “&” before the desired keyboard hotkey for access the menu with the keyboard.
setmenumsg is the help text shown in the Sailwave status bar when hovering over the menu item.
setdisabled should have value a value of 0 to display the template in the menu and 1 to hide it. You can use this technique to hide factory menus. Create a custom menu with the same file name as a factory template, then disable it using this option.
end just tells Sailwave that no more template.* callbacks are in the template. This is used when constructing the publishing menu – i.e. Sailwave does not need to read the whole file – just up to template.end.
The following callbacks to global variables can be used.
Current view font characteristics. In this way you can control the published font based on what you are looking at:-
Fields from Setup+SeriesProperties:-
The current year:-
<h2>`event.name` at `venue.name` `date.year`</h2>
The current source file name:-
<meta name="filename" content="`filename`">
You can reference an external file using the html.include template. For example:-
The factory templates use this technique to load common template fragments.
The following user interface callbacks can be used. See the factory templates for examples of their use:-
Proceed as for templates above but using the appropriate folder and fields. Your style either replaces the factory one in the drop-down list when publishing or is added to the list if it has a file name different to any of the factory styles.
Styles can include the callbacks described above but only view.* make any real sense in this context.
To find out what classes Sailwave applies to elements, publish a series with everything included (summary tables race tables with all columns, prizes, codes, notes etc) and look at the source.
Proceed as for templates above but using the appropriate folder and fields. Your effect either replaces the factory one in the drop-down list when publishing or is added to the list if it has a file name different to any of the factory effects.
Effects can include the callbacks described above.