Template files location

Hi Huw,

I thought I would use some time over the Christmas break to figure out the template file system. I want to do something with additional sponsor logos for a major event we have coming up in May.

I started to edit the base files in Program files (x86) → Sailwave → Templates, but realized that these are locked files. So I copied header.txt and header2.txt to a working folder, and pointed SW to that folder using Setup → Global options → Folders → My template files.

The for testing purposes I made a trivial change to header2.txt (changed “results” to all caps) and ran a fresh html file saved as test.hml. Didn’t work. So then I copied ResultsV2.htm to my working folder to see if the two files needed to be in the same folder. Didn’t work.

Ran out of ideas. Using SW 2.29.0

Any suggestions?

Thanks,

jrc

Hi John,

Great to have someone thinking in advance of what they want to do :wink:

My suggestions are:

  • use C:\Users\Public\Public Documents\Sailwave\templates as the location for your custom templates, header.txt & footer.txt files. Default header & footer .txt files should already be in this folder.
  • copy the templates you are planning to use from C:\Program Files (x86)\Sailwave\templates to above location
  • rename templates you copy to something appropriate for the event in question
  • make copies of header & footer .txt files and name appropriately for the event in question

    This shows naming I used for two events I scored recently.

So the templates appear with a unique name when opening the Publish menu, the second line of the template .htm file needs editing, carefully, between the & and … characters. For example, in my ResultsV2-Feva.htm I changed “&Results V2 …” to “&Results V2 Feva…”

To make use of the custom header and/or footer .txt files, one or two lines at the end of the .htm file(s) need editing to reflect the custom names used for the header & footer .txt files.

What sort of look & feel have you in mind?

I look forward to helping achieve your goal.

PS - I have started writing and advanced publishing guide which extends what is already in the Sailwave User Guide.
Kind regards,
Huw

Hi John,

I see Huw has answered your questions. Just for anyone else reading the thread I would recommend leaving the templates folder at C:\Users\Public\Public Documents\Sailwave\templates as there are already some of the files there when Sailwave is installed and it is set as the default location when Sailwave is installed so there is no need to modify the location of the Templates folder.

Jon

Huw,

Thanks very much, as always. I’ll proceed as instructed.

As a guess, could I imagine that, notwithstanding the setup menu, the file location might not be completely settable in this version? But, hey. It’s Christmas.

As to look and feel, not sure. Wanted to offer the regatta chair some options, since we’re starting to accumulate sponsors. The example with burgees at the bottom of the page looks promising. Also the moving images you showed us a couple of months ago. Time to play. No regattas for me till April.

Happy season to all, and great thanks to you and Jon for this excellent project!

jrc

Hi John,

Yes you can change the template file location in Sailwave, It is just Jon and I do not recommend as a standard thing. However, I would recommend changing if one wanted to have all the Sailwave templates available for a regatta that use a customised header and /or footer .txt file.

Did you see this presentation of results for ILCA Worlds down in Mexico? Sailwave results for 2022 ILCA 6 Masters World Championship at Vallarta Yacht Club 2022

I am quite confident that it will be possible to produce a good look. Hardest part is usually getting the graphics!

I like to obtain logos in a native scalable vector format, like SVG or EPS, as these allow the best reproduction when converted to appropriate size in PNG, JPG or GIF. Long thin images are the worst to deal with for scaling.

I would recommend always getting images in a larger size than will be displayed as they scale down well; whereas scaling up bit-map images leads to a blocky look.

Here for advice if required.

Happy holiday season.
Kind regards,
Huw

Huw,

Thanks for the ILCA file. I have actually seen this before — my colleague and friend Al Clark won the Grand Master fleet. This is a useful presentation. I assume it was done by sticking either a table or a pair of css Div statements in the body. I’ll see what works.

Anyway, thanks for your support. Got some time to sort this out.

As to the file locations, I’m thinking it would be best to keep the templates in the standard location, rather than in a local folder. Otherwise things could get very fragmented.

A question: how is the menu order determined? I’m now seeing V2 as the first item. That might be because only V2 is in the Public folder? Doesn’t really matter — the naming convention you described works fine.

Thanks,

jrc

Hi John,

Answering your question about menu order - change the numeric value in the .htm in the first line:
template.setmenurank(100)
A smaller numeric value means that template is nearer the top of the list when Publish is selected from the menu.

All the code for and instructions for replicating the ILCA layout are in a document I have if you would like a copy. The layout was created by Andy Barrow down in Mexico.

Kind regards,
Huw

Just a little additional comment on the great work you are doing. Setting a common folder for templates, styles, etc. is a great way to standardize across the people in your club who do scoring. We use a common Dropbox folder that is shared among the usual scorers. That way we can standardize on the appearance of the score presentation, as well as share what others have done to enhance scoring presentation.

Perhaps sharing template files among the people in this group might be a great way to give folks a leg up?

I have a different problem on the same topic… Sailwave isn’t picking up the template files from the specified directory, i.e. it’s using the footer in C:\Program Files (x86)\Sailwave\templates, not the one in C:\Users\Public\Public Documents\Sailwave\templates (or other directory that I specify in global settings).

The reason I know it’s using C:\Program Files (x86)\Sailwave\templates is that I modified the footer file in that directory (sure, bad practice, but I needed to know what was going on) and the changes turn up in my published content.

So the question is how do I get Sailwave to actually use its global folder settings? A colleague here has experienced the same problem.

Hi Mark
For best practice, I recommend you create your own option on the results menu rather than modifying the standard results
To do this copy the results.htm, header.txt, and footer.txt from the C:\Program Files (x86)\Sailwave\templates and place them in the C:\Users\Public\Documents\Sailwave\Templates
Now rename them to resultsMT.htm, headerMT.htm and footerMT.htm obviously the names can be anything of your choice
Edit the resultsMT.htm to look similar to this
The second line is how it will appear in the Publish menu within Sailwave in this case Mark Thompson Results
The first line allows you to adjust where it appears in the menu

And at the end, you will see the three lines where you can choose which Header and Footer files to use
Here you can modify the header and footer files headerMT.txt and footerMT.txt without affecting any others

template.setmenurank(100)
template.setmenutext('Mark Thompson Results')
template.setmenumsg('Publish Results with Custom Header/Footer')
template.setdisabled(0)
template.end()

string.set("contents", "Contents")
string.set("overall", "Overall")
string.set("prize.title", "Prizes")
string.set("prize.col.rank", "Rank")
string.set("prize.col.category", "Category")
string.set("prize.col.competitor", "Competitor")
string.set("codes.title", "Scoring codes used")
string.set("codes.col.description", "Description")
string.set("codes.col.code", "Code")
string.set("codes.col.points", "Points")
string.set("summary.caption.sailed", "Sailed: ")
string.set("summary.caption.discards", "Discards: ")
string.set("summary.caption.tocount", "To count: ")
string.set("summary.caption.toqualify","To qualify: ")
string.set("summary.caption.entries", "Entries: ")
string.set("summary.caption.ratings", "Rating system: ")
string.set("summary.caption.scoring", "Scoring system: ")
string.set("race.col.start", "Start")
string.set("race.col.finish", "Finish")
string.set("race.col.elapsed", "Elapsed")
string.set("race.col.laps", "Laps")
string.set("race.col.corrected", "Corrected")
string.set("race.col.bce", "BCE")
string.set("race.col.bcr", "BCR")
string.set("race.col.speed", "Ave speed")
string.set("race.col.place", "Place")
string.set("race.col.points", "Points")
string.set("race.start.start", "Start: ")
string.set("race.start.finishes", "Finishes: ")
string.set("race.start.time", "Time: ")
string.set("race.start.distance", "Distance: ")
string.set("race.start.weight", "Weight: ")
string.set("race.start.course", "Course: ")
string.set("race.start.wind", "Wind: ")
string.set("race.start.winddir", "Wind dir: ")
string.set("race.start.windstrength", "Wind strength: ")
string.set("race.start.windspeed", "Ave wind: ")
string.set("[summary.col.race.rank1.td](http://summary.col.race.rank1.td)", "rank1")
string.set("[summary.col.race.rank2.td](http://summary.col.race.rank2.td)", "rank2")
string.set("[summary.col.race.rank3.td](http://summary.col.race.rank3.td)", "rank3")

html.include('headerMT.txt')
html.resultswiz()
html.include('footerMT.txt')

image.png

Thanks, that worked perfectly (though still not sure why just editing the footer in C:\Users\Public\Documents\Sailwave\Templates doesn’t work).

Unfortunately on the day we ended up with a completely different problem… Despite testing the scoring and publishing process extensively prior to the regatta, when we attempted to score 4 divisions for an 80 boat, one race event with two different start times, we got an error message saying that one of the divisions had both elapsed time and place data entered and that the as a result the race couldn’t be scored by division.

In reality the data that was entered was finish times only as we had configured in ‘edit race’ and there was no place data entered. So in the end, under considerable time pressure we had to resort to Excel just to be able to get results to the commodore in time for prizegiving and we still haven’t published to our website.

No doubt we’ll figure out what went wrong in the coming days but this was an unfortunate failure.

Hi Mark

Send me the .blw. And I’ll have a look for you

Jon

Thanks Jon, though not obvious how to do that… the upload button? - says not available to new users. Is there another way?

You should be able to attach it but if not you can email it to me at Jon@Sailwave.com

For those following this thread

Mark emailed me the file and there was one result in the division reported by Sailwave that had a place finishing rather than the time that should have been there.

Thanks for your help.