Generate UIDs for Tiddlywiki
How do I generate a unique title for a new Tiddler?
Questions like this one pop up fairly regularly at the Tiddlywiki mailing list. I had the same problems when I just started out and so I know the struggle when one does not know how to create a Tiddler scheme that either does not need the title or does generate somewhat unique IDs automatically.
For most things I do with TiddlyWiki I use it as a CRUD platform and create forms which modify and create Tiddlers behind the scenes. For these kinds of setups I do not care about the Tiddler names at all since I never look for them directly and all data retrival happens via filter operations over their fields.
So most projects I create follow a workflow like this:
- Enter mostly uniform data/information into a form build from Widgets to create a new record of some sort (i.e. new book in my library).
- Have a standardised view on those records (every book has a title, cover, author, short summary and release year). For this I use ViewTemplates, which show record fields in whatever way I need to.
- Have a view over all records of one type similar to TiddlyWiki's own Tiddler manager where I can delete/update records.
Creating these forms in the first place needs some getting used to since they are build from WikiText and abovementioned Widgets. But so far I could achieve every layout I wanted this way and by now most projects are just a copypasta of previous ones I made.