Hi all,
I’ve started today using a Tiddlywiki!, but I don’t know how to organize the following structure which is a very simple tiddlers only ‘meals plan’ (for the moment).
Here below is the list of tiddlers I was thinking to create, a conceptually nested structure having as parent the journal of the day, but I’m already blocked on how to name the nested ‘time of day’ to be unique.
The tiddler titles have to be unique, there is no way around that. You have probably imagined something like “folders” for each day, each containing tiddlers with the same titles. The way TW works, you have to imagine that all tiddlers are in one “folder”, so their names have to be unique. But there are many other ways to achieve the structure that you need.
I would go for titles like 2024-02-27/Morning and so on.
There are many ways you could make you life easier. If you share some more details of what you would like to do, we might be able to help more. Some loose ideas, guessing what you could need:
Have each journal tiddler (tagged Journal) display buttons to create (if not existing) / open (if existing) the specified time of day tiddlers.
Have each time of day tiddler display buttons to create / open the “parent” journal or “sibling” times of day tiddlers.
Have a page toolbar button to create a time of day tiddler with the current date and time of day based on the current time.
Style the title 2024-02-27/Morning so that the date is a bit de-emphasized and the time of day is more prominent, or the other way around, similarly to how system tiddlers (e.g. $:/ControlPanel) de-emphasize the $:/ part.
Thanks @vilc !
Yes using a ‘folder’-like approach was my thought, but I see now that it is only 1 folder with all tiddlers inside.
The suggestion of using Date/Time was actually what I start doing yesterday before posting here but I wasn’t sure it was a good approach, so thanks for your detailed answer! (and thanks for the hints, indeed it requires some QoL changes which could be introduced incrementally, I had a quick read of the grokTW book, TW is impressive!).
In truth I have still to think/decide why having time-of-day tiddlers can be more useful than placing everything in the same Journal entry (maybe I’m overdoing it).
For example if I use only the Journal entries I would need some structured wikitext, like sections/accordions, one for each time-of-day, that I might need to query with some filter operators; having instead time-of-day as tiddlers I could use TW engine for the querying.
But ok, it seems that I’ll have to first think on how I want to use this ‘meals plan’
If you are going to use mostly regular “sections” (e.g. always the same four times of day),
if you might want to view/compare certain sections from multiple days (e.g. view all Mornings together),
if the individual sections make sense to be viewed on their own, without looking at the rest of the sections or data from that day
then going for separate tiddlers for the sections/times of day is a good idea. If you’re unsure, it is always safer to give the data too much structure (splitting into separate tiddlers) and then collapse/compress, than the other way around.
If, on the other hand, you might use “irregular” sections with varying, free-text headings,
if their content makes sense only next to the other sections in this day
then storing everything in the day/journal tiddler seems easier and not overdone. If you go this way, the Section Editor plugin might be of your interest. Although my personal view is that if I need section editor for a tiddler, this means that tiddler is too long and should be split. And as a new user, I would try to avoid relying on plugins too much with my data structure.
Grok TW is a great resource, I started with it too. Bear in mind that there are some new nice things in the recent TW versions, which make some of the problems discussed in Grok much easier to solve or understand. If you’re interested, I would suggest taking a quick look at:
procedures, which are “better macros”, easier to understand and use.
I think, before you dig deep into, how you want to implement something, it would be better to define your “final result” in plain text, without any implementation details.
The implementation is the last step, after you actually know, what you want.
Tags are very powerful in TW, but as Mateusz (vlic) pointed out, they fall short if you need the same tiddler name, “connecting” it with different elements and “different content”.
The folder like structure, we call TW namespaces, which is used a lot in the core system tiddlers.
From your OP (original post) I can see, That you would like to have YEAR-MONTH-DAY, YEAR-MONTH-DAY+1 … Journal tiddlers.
My first question now is:
Do you want to create different journal tiddlers upfront, or are they created each day?
Since you mentioned “meals plan” I suspect they should be created upfront. – But I may be completely wrong here. But it makes a difference, for the implementation details.
OK. The little word “or” is the tricky one here. So how should it exactly look like, if there
is a meal name
single food
Q4
Is it possible that there is a meal name and single-food, or several single-foods?
Creating Journal tiddlers upfront is a bit tricky, because we do not have a functionality like that out of the box. But it’s relatively straight forward.
We do have an unusedtitle Macro which can use a template and a $count$ variable. So it’s possible to create something as follows. There can be a year-selector, a month-selector and the button will create tiddlers 2024-02-00 … 2024-02-01 and so on.
At the moment it has to start with 00, but there is a pending pull-request at GitHub, that will allow us to start with 01.
Creating different meal-tiddlers should be easy. We create a tiddler eg: meal-1 and tag it: meal. These tiddlers can contain all the info that is important for that meal. done
TW also has the possibility to customize field inputs in edit mode. So eg: every field that has a suffix eg: -meal should show a dropdown, that list all the tiddler tagged: meal (This concept is complex, because the documentation is a bit cryptic) – But the result is cool.
Using the menu(s) approach is actually a great way to solve the meals/foods, I could put food/meals variations in new menu(s) tiddlers (so this answer to the Q4 and the “or” problem ) as there shouldn’t be many.
Thanks a lot for all the info and the prototype!
I’ll give a try with this approach and see how it works out.
You are welcome. If there are any questions, just ask. I did put some links in there, that should point to the documentation of the different elements used.