8.1 Note Files ↑
8.1.6 Class Template Files
Starting with Version 7.7.0, the user may specify a special template file for each different class of Note within a Collection.
A Class template file can serve two different purposes:
A class template file may specify a subset of all fields within the Collection to be available when adding/editing a Note of the specified Class. This can be useful if the Collection identifies a long list of field labels and types, but only some of these are relevant to Notes of a certain class: the Edit tab then becomes a lot cleaner.
A class template file may specify default values for one or more fields, to be presented on the Edit tab when adding a new Note of a given class.
Here’s how to make all of this work.
Tailor the Collection Settings and make sure the Class field has a check mark next to it.
Also make sure that all of the fields you might want for any class are specified for the overall Collection Settings: this list of field labels should be a superset of any appearing for a particular class.
If you’d like, you can specify a list of possible values for the class field within the Collection Template file.
Here’s an example of how you would do this:
Class: <class: biblio, cover, def, quote, text, title>
In other words, enter the usual field label, followed by a colon, and then follow that with the possible values, separated using commas or semicolons.
Be sure to Reload the Collection after making changes to the Collection template!
Once you’ve enabled a Class field, you can use the
Generate New Class Template...
item beneath theCollection
menu to create a class template file. These files will be stored within a subfolder namedclass
, within the folder holding your Collection’s Notes. The name of the file should be in all lower-case letters, and this name will become the name of a class available for that Collection, irrespective of whether you’ve entered that class name as indicated above, within the Collection template file.After creating the requested class template file, Notenik will ask macOS to open the file within your preferred text editor.
The new class template file will have all of the Collection’s field labels called out, but without any following information. You can now make two sorts of changes to the generated file.
You can delete the entries for any field labels that you do not plan to use with this class;
You can specify default values for any of these field labels, to be provided whenever you create a new Note of this class.
When you’re done making these changes, save the class template file within your text editor, and then Reload the Collection within Notenik.
When creating a new Note, you can now use the New Note with Options item beneath the
Note
menu to select a certain class value for your new Note. The Edit tab will then reflect the entries you have made in that class’ template file.If you change the class value for a Note, then you will need to save the change, then re-edit the Note, in order to see the limited set of fields that you may have specified for that class.
There are special rules for Specifying a Default Title Value.
Next: 8.1.7 The defaults Class Template