RealAlHazred
Frumious Flumph (Your Grace/Your Eminence)
So, a more involved example of the kinds of things you can do with fields. Here is the "Books" tiddler from my CoC TW.
The bit on the right, where you see a tab called "Contents" with items under it, is a basic function in TW. Tag any tiddler with "TableOfContents" and it will show up there. So you can easily sort and organize your info.
This is the code in the "Books" tiddler.
This is a lot of code, but it's all the same thing. I've set it up do "<book title> — <language(s)>, by <author(s)>, tr. by <translator(s), if any> (<printing city(ies): <publisher>, <date of publication>)" and a lot of the code is just to do the following:
There are ways to automate and make life easy in a number of ways. I'm not good at teaching, so I'm going to hit them in a mostly random order.
The bit on the right, where you see a tab called "Contents" with items under it, is a basic function in TW. Tag any tiddler with "TableOfContents" and it will show up there. So you can easily sort and organize your info.
This is the code in the "Books" tiddler.
This is a lot of code, but it's all the same thing. I've set it up do "<book title> — <language(s)>, by <author(s)>, tr. by <translator(s), if any> (<printing city(ies): <publisher>, <date of publication>)" and a lot of the code is just to do the following:
- If the book has a "caption" field, use the "caption" field contents instead of the tiddler title. That way, I can have the tiddler titled "Necronomicon" and the caption say "The Necronomicon" and have it show up how I like it in the list.
- Every book has an author in the "author" field. The author section checks if there's a "caption" field on the author tiddler. All of the authors have this, since the tiddlers are titled something like "AlHazred, Abdul" but the captions are ordered as "Abdul AlHazred". This is, again, a way to get it to show up in the list in a way that I like. It also checks if there's more than one author, and if there is, it lists them as "<author A>, <author B>, & <author C>". Again, all this is because my autism requires the list to look a specific way.
- Some books have a translator in a "translator" field. That section checks if there is one, and if there is, lists the "caption" field from the translator tiddler, again sorting more than one translator in the Oxford style.
- All books have a location of printing in a "place" field. This section checks for the "caption" field in the place tiddler, and uses that, and if there's more than one, sorts it the way I like. Really, if I wasn't such a stickler for appearances, the code would be one-tenth the size it is.
- The same process happens with the book tiddler's "publisher" field, pulling the "caption" field of the publisher tiddler.
- Finally there's the date. You can format dates very easily, and I've set it to just use the four-digit year, and append "BCE" or "CE".
There are ways to automate and make life easy in a number of ways. I'm not good at teaching, so I'm going to hit them in a mostly random order.






