14. Putting It All Together ↑
14.6 Create a Commonplace Book with Lookup Fields
I’ve maintained my own Digital Commonplace Book for years, and one of the challenges with maintaining a collection of notable quotations is the repetition of information from one Note to another: the same author, and even the same work, along with accompanying information, may be repeated numerous times. It is annoying, tedious, time-consuming and error-prone to re-enter that information on each Note, but there is no workable alternative when dealing with only a single flat file (or single Collection of Notes, in our case).
Version 7.0.0 of Notenik,however, introduced Lookup fields, which allow one Collection to reference Notes in other Collections, and we can now use such fields to solve our repetition problem.
And starting with Version 9.2.0 of Notenik, you have an option, when created a new Collection, to initialize it as a Commonplace with Lookups
. This is now the best way to start creating your own Notenik Commonplace book.
So, if you haven’t already, I suggest you go ahead now and create a new Collection for yourself, using the Commonplace with Lookups
model as your starting point. The rest of this article will then walk through your new Collection to explain how everything works.
In order to understand all the details, it may help at times to make use of a text editor in order to see what’s going on under the hood.
Three Nested Collections
First, we need to understand that our Commonplace book consists of three different Notenik Collections. We might arrange these Collections in a variety of positions relative to each other, but my model implementation has these three Collections nested within one other. The author-notes
folder is at the bottom, within the author-works
folder, and the author-works
folder is within the main folder (however you have named it). There are a couple of advantages to arranging things this way:
- When you open the top folder, you will automatically be granted access to all three Collections;
- There’s less chance of the Collections becoming separated or disconnected from one another.
So now let’s look at each Collection in turn, starting at the bottom. We’ll look at the Collection Template File for each Collection, since this is where the fields are defined, as well as the relationships between Collections.
You may find it handy to use the Open Project Folder command on the top folder of your new Commonplace book, since this will give you a convenient way to open each of the three Collections in turn.
Commonplace Book
And now, finally, we’re ready to look at the commonplace book itself. I’ve called mine commonplace-book
, and here’s its template file:
Title: <title>
Author: <lookup: qauthors>
Date: <date>
Tags: <tags>
Work Title: <lookup: qworks>
Work Pages:
Date Added: <dateadded>
Body:
The Title
field for each quotation is just some brief and meaningful excerpt from the full quotation, which goes in the Body
field: just keep in mind that each Note – each quotation, in this case – must have a unique title.
Note that I’m now using lookup
fields for both Author
and Work Title
. I could have skipped the inclusion of Author
here, and just pulled it from the Work Title
lookup, but I’ve included it explicitly here for a few different reasons.
I want to be able to sort the quotations by Author, and I wouldn’t be able to do this if the Author’s name was relegated to a secondary Collection;
I want the Author’s name to be immediately visible, without having to click on a disclosure triangle to reveal it as part of the information about a particular work;
In some cases, the author of a quotation may be different from the author(s) of a work – for example, if the author of a work chooses to quote or cite another author.
I’ve also repeated the Date
field here, for somewhat similar reasons.
At first glance, the field Work Pages
field may seem like information about a work that could be moved to the Author Works Notes, but this is actually meant to call out the pages of the work on which this particular quotation was found, and so remains information about the quotation, and not about the work more generally.
Making Use of Your Commonplace Book
When viewing one of your quotations on the Display tab, you’ll see that both of the lookup fields – Author
and Work Title
– appear following disclosure triangles (so long as there is some additional info to disclose). Click on one of the triangles, and you’ll see additional info appear that is being pulled from the appropriate Lookup Collection.
You’ll also see that both of the Lookup field values appear as hyperlinks. Click on one of these, and the corresponding entry in the appropriate Lookup Collection will be opened for you, in a separate Collection window. This is handy when you wish to add or edit an entry in one of these Lookup Collections.
Edit one of your quotations, and you will see that the Author and the Work Title both appear as drop-down menus, allowing you to select an existing value from one of these Lookup Collections.
Summary
Lookup
fields can be used for many more purposes, but this project should give you some idea about how to implement them in at least one practical, real-world example.
Next: 14.7 Write a Web Book