New journal tiddler with pre-defined fields

52 views
Skip to first unread message

Boazter

unread,
Dec 31, 2022, 11:21:15 AM12/31/22
to TiddlyWiki
Greetings!

I would like to automatically add fields when I start a journal tiddler. I've searched and don't find an easy way to do this. Some of the comments I've read seems overly  complicated and is over my head. I only dabble in the behind-the-scenes code, my level being "tinkerer." Looking at some of conversations and piecing together things, however, it seems to me that I could simply add text in the $action-sendmessage command within $:/core/ui/Actions/new-journal.

Now, I suspect this will cause a visceral reaction throughout the community–shock and howls of outrage. I imagine you'd want me to clone some shadow tiddler or other and update or entirely rewrite others; but, I mean, if I'm careful and test it out first, is that not a solution? It seems to work on my test tiddler. Will I break something else or cause some other major issue that I'm not aware of?

Below is my proposed change to $:/core/ui/Actions/new-journal with the simple addition of the following:

field1="F1 Default" field="F2 Default" field3=""

\define get-tags() $(textFieldTags)$ $(tagsFieldTags)$
<$vars journalTitleTemplate={{$:/config/NewJournal/Title}} textFieldTags={{$:/config/NewJournal/Tags}} tagsFieldTags={{$:/config/NewJournal/Tags!!tags}} journalText={{$:/config/NewJournal/Text}}>
<$wikify name="journalTitle" text="""<$macrocall $name="now" format=<<journalTitleTemplate>>/>""">
<$reveal type="nomatch" state=<<journalTitle>> text="">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<get-tags>> text={{{ [<journalTitle>get[]] }}}/>
</$reveal>
<$reveal type="match" state=<<journalTitle>> text="">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<get-tags>> field1="F1 Default" field="F2 Default" field3="" text=<<journalText>>/>
</$reveal>
</$wikify>
</$vars>

Is there a better way to do this? An easier way than cloning and rewriting code?

Thoughts, recriminations?

Thanks much!

Boazter

unread,
Jan 7, 2023, 10:45:33 AM1/7/23
to TiddlyWiki
Just to close this out. The following link seems to answer my question and affirm that it's not a terrible thing to change $:/core/ui/Actions/new-journal  (although it references "new-tiddler" instead). 


I will direct my further inquiries to the https://talk.tiddlywiki.org site. Thank you, Mohammed, for sending me there!
Reply all
Reply to author
Forward
0 new messages