Is it possible to apply dynamic tags on new tiddlers?

108 views
Skip to first unread message

Wpq

unread,
Jul 6, 2020, 5:48:06 AM7/6/20
to TiddlyWiki
Hello everyone

When visiting the options (I just started with TiddlyWiki) I noticed that it is possible to add tags by default on new tiddlers.

Can these tags be automatic? It would be awesome to be able to add tags such as "Monday", "Week 28", "morning" - tags which would be dynamic depending on some context (typically the date or time I guess)

PMario

unread,
Jul 6, 2020, 6:58:38 AM7/6/20
to TiddlyWiki
Hi,

That's not possible out of the box. ... Someone would need to make a "special" New Tiddler button, that contains some logic as you describe it.

-mario

PMario

unread,
Jul 6, 2020, 7:01:24 AM7/6/20
to TiddlyWiki
Hi

TW has no info about the Week number.

_And_ counting week numbers is different between eg: US and Europe! So they are different sometimes! ... Which means not 100% reliable.

-m

Wpq

unread,
Jul 6, 2020, 7:11:45 AM7/6/20
to TiddlyWiki
The week number was just an example (though it is defined in ISO 8601  https://en.wikipedia.org/wiki/ISO_week_date but indeed it changes by local tradition). I was more wondering about the general idea of being able to add dynamic data to tags.

Thanks for the feedback!

TW Tones

unread,
Jul 6, 2020, 8:08:00 AM7/6/20
to TiddlyWiki
WPQ,

The ability to add tags on tiddlers is in someways a simple extra option. It is not really for more sophisticated use. You could use it while creating a dozen new tiddlers manually all of which you want to have the same tag(s)

The thing is the tags you add on the Control Panel info panel are added to $:/config/NewTiddler/Tags and this is the source of tags when using the new tiddler button.

If you generate your automatic tags and tag $:/config/NewTiddler/Tags with those, subsequent use of the new tiddler button will add them. However to do something automatic you may need to use startup actions, perhaps via the startup actions plugin which is more advanced https://ooktech.com/jed/ExampleWikis/StartupActions/

However, I think there is a much better approach especially with dates and time. Firstly as you  create a tiddler NOW it gets a created date automatically. From this created date you can always calculate what the day of week, week number is, even 24hour time of day you could use to determine its morning and much more (use the ViewWidget date format and template), is so no need to waste a tag on it. If the created or modified dates are not what you want you can always get your new tiddlers stamped or selected with another home made date field.

The new tiddler and New Journal buttons are there for new comers, but when you start making custom tiddlers and want to automate things learn about creating a button or cloning an existing button, and adding additional actions for additional outcomes like tagging, creating fields and a lot more, such as using a template according to context.

Then the next step is to learn how to use the list widget to to get a date field and use it for selecting what to display. For example the days operator allows you to all tiddlers in a date range by any date field.

We can help you learn all of the above, and plugins and macro's become available to do this kind of thing every day.

Your could say people build so many things with tiddlywiki, there are plenty of wheels around, so you do not have to reinvent the wheel very often, just work out what you want you vehicle to do.

Regards
Tony

Wpq

unread,
Jul 6, 2020, 8:17:17 AM7/6/20
to TiddlyWiki
Thanks for the answer.

I am just starting, I discovered TiddlyWiki today. After 25 years of making notes in all kind of environments (either the ones I coded myself, or OneNote, Evernote, Joplin, you name it).
This is the first time I see a system which is so versatile - I will invest time during the summer to understand it more deeply.

And the community is great :)

TW Tones

unread,
Jul 6, 2020, 8:30:27 AM7/6/20
to TiddlyWiki
Wpq,

Welcome to the community. I can see the possibilities are slowly coming to you.

If you embrace tiddlywiki, I do not think you will every look back. We volunteers in the community can help you a lot, no question is a silly question, but searching tiddlywiki.com or our forums is the first place to learn.

Tiddlywiki is a platform for notes, websites apps and much more. It democratises information technology by putting the power in the hands of the user to evolve a solution with their needs. Based on industry standard protocols like html and css and easy ways to use these, built in javascript much of what you learn with tiddlywiki are using industry standard technologies, skills you can use elsewhere. Although you can avoid a lot of coding with editions and plugins made in the community or built in to tiddlywiki.

Regards
Tony

Mat

unread,
Jul 7, 2020, 1:26:05 PM7/7/20
to TiddlyWiki
I actually think it can be done!  Modify

$:/core/ui/Actions/new-tiddler

to read

<$set name=tags filter={{$:/config/NewTiddler/Tags}}>
<$action-sendmessage $message="tm-new-tiddler" tags=<
<tags>>/>
</$set>

This makes it accept filters which are evaluated before they become the tags. So, in the settings field for new tags, you can now type e.g 

[tag[HelloThere]]

...to get all tiddlers tagged such. Or use the filter

[enlist<now>nth[3]]

To, at the moment, get "July" (<<now>> is a core macro that gives the date)

If you fiddle with the date formats in the <<now>> macro and some math inside the filter, you might be able to get week.

<:-)
Reply all
Reply to author
Forward
0 new messages