8 Contents of a Merge Template ↑
8.2 Merge Template Commands
Commands provide overall instructions to Notenik for how to merge the note data with the template.
Following are the three most important commands.
<?output "filename.ext"?>
<?nextrec?>
<?loop?>
The output command provides a name and location for the output file to be created.
The lines before the nextrec command will only be written out once.
Lines between nextrec and loop will be written out for each note being processed.
Any lines following the loop command will only be written out once, following the processing of the last note.
An important concept to understand is that the output filename can be based on a variable – on the contents of one of the fields within each note. A related concept is that the output command may either precede or follow the nextrec command.
If the output command precedes the nextrec command, then only one output file will be created, and the file name to be output cannot contain a variable. This would typically be used to create an index file, or a list.
On the other hand if the output command follows the nextrec command, then one output file will be created for each note, and the output file name should include a variable from each note, so that a unique file name is generated for each note. This would typically be used to create one web page for each note.
See the Knowledge Base for a complete list of Merge Template Commands.
Next: Merge Template Variables