Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
Tinderbox Users >> Questions and Answers >> Setting HTMLExportTemplate attribute

Message started by rtalexander on Oct 9th, 2007, 7:32pm

Title: Setting HTMLExportTemplate attribute
Post by rtalexander on Oct 9th, 2007, 7:32pm


It appears that the attribute HTMLExportTemplate must be set manually from an HTML view. Is this correct?

I have a prototype, @Assignment, that has a default value set for HTMLExportTemplate. When I create a new note, assign @Assignment as its prototype, and then open an HTML view for the new note, I find that the combo box for selecting the template says "Choose template...", and the rendered output is from the default template assigned for the document, not the template referred to by the default value of HTMLExportTemplate for the note in question. I have to manually choose a export template file from the drop down list. Is there someway to get Tinderbox to automatically use the value of the attribute if it is not empty?

Title: Re: Setting HTMLExportTemplate attribute
Post by Mark Anderson on Oct 10th, 2007, 6:10am

Make sure that the template file set by @Assignment is stored in the same folder as that set for the HTML default template as an app or document level preference. The latter must be set for your method to work.

TB assumes you have set an app or TBX level preference for the default template (folder and) file. Once this, any template file in the folder is available via the HTML View selector button and if set via HTMLExport.

In testing your problem, I've noticed one other 'gotcha'. TB will allow you to set HTMLExportTemplate via the Info view or act action/rule to a template that is in a different folder to the 'base' folder set in the preferences. Doing this in v4.0.0+ un-sets the document-level preference and, well... causes some confusion. I can sort of see how this arises and I'm sure it is the law of unexpected consequences at work. Sadly the app doesn't warn you that you're setting HTMLExportTemplate with a value that will trash the app/doc setting.

The drill should be to always set the TBX document (or app level) HTML template folder before using the TBX and to keep all templates in the that folder. But what if you want to keep different sets of templates in separate folders, for instance because of same name file/different code for different projects? Fine for existing TBXs or if you remember to set the document level HTML preferences on starting a new file.  If like me you're the forgetful kind you could make a 'prototype TBX' with the settings made and store it as a stationery file (if unsure about the latter type "Using files as stationery" into Mac OS Help). N.B. this tip won't work for TB(Win) when it comes as stationery files are a feature of the Mac OS.

If you've never set an app level preference - or moved the existing target folder - the app defaults to pointing to the users Home folder. From v4.0.0 onwards (IIRC) in the TB app package now includes a folder of 4 or so templates allowing some use of HTML view/export without having a folder set.

Title: Re: Setting HTMLExportTemplate attribute
Post by Mark Bernstein on Oct 10th, 2007, 11:11am

HTMLExportTemplate inherits a default value from the DOCUMENT Preferences; you should set the preferences before exporting.

1) Choose document preferences (cmd-8) from the edit menu
2) Select the HTML Export Pane
3) Click on the Export Template button and select the export template you prefer.

Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com) » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.