How to add fields to new-journal?

238 views
Skip to first unread message

HC Haase

unread,
Jan 7, 2020, 3:16:33 AM1/7/20
to TiddlyWiki
I want to add some custom fields to the journal tiddler. 

Without luck, I tried to add the field exercise="" to the  $:/core/ui/Actions/new-journal like this

<$vars journalTitleTemplate={{$:/config/NewJournal/Title}} journalTags={{$:/config/NewJournal/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=<<journalTags>> exercise="" text={{{ [<journalTitle>get[]] }}}/>
</$reveal>
<$reveal type="match" state=<
<journalTitle>> text="">
!! <$action-sendmessage $message="tm-new-tiddler" title=<
<journalTitle>> tags=<<journalTags>> exercise="" text=<<journalText>>/>
</$reveal>
</$wikify>
</$vars>

am I editing the right tiddler?

thanks

HC Haase

unread,
Jan 7, 2020, 4:27:33 AM1/7/20
to TiddlyWiki
 And btw. Is there a reason why journal tiddlers don't use a template tiddler?

PMario

unread,
Jan 7, 2020, 9:54:00 AM1/7/20
to TiddlyWiki
Hi,

Did you try to de-activate and re-activate the "New journal" button? ... There may be a "refresh" problem.

It worked for me, disabling and enabling the button with the right sidebar: Tools menu.

-m


J Mc

unread,
Jan 8, 2020, 8:51:48 AM1/8/20
to TiddlyWiki

HC Haase,
 
Replace the shadow tiddler  $:/core/ui/Buttons/new-journal with the contents of attached file

$:/core/ui/Buttons/new-journal-with-exercise field

\define journalButton()
<$button class=<<tv-config-toolbar-class>> tooltip="New Journal">
<$action-sendmessage $message="tm-new-tiddler" $param=<<now 'DDD DDth MMM YYYY'>> tags="Journal" exercise=""/>
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
{{$:/core/images/new-journal-button}}
</$list>
</$button>
\end
<<journalButton>>
$__core_ui_Buttons_new-journal-with-exercise field.tid

J Mc

unread,
Jan 9, 2020, 2:24:16 PM1/9/20
to tiddl...@googlegroups.com


On Wednesday, 8 January 2020 13:51:48 UTC, J Mc wrote:

HC Haase,
 
 
Another example - how to add a field "exercise" to a Journal tiddler.

The Journal tiddler can be created initially by the New Journal button on the page toolbar.
Open the new Journal tiddler for editing.
Click the Button Click to add Journal fields and the exercise field will be added, save the tiddler.
journal example.html

HC Haase

unread,
Jan 10, 2020, 3:56:39 AM1/10/20
to TiddlyWiki
@pmario
Thanks. That solved it. but it seems strange to me, that the placement of the button influence how it is refreshed.

@J Mc
Replace the shadow tiddler  $:/core/ui/Buttons/new-journal with the contents of attached file
I don't want to change the structure of the wiki too much, so I prefer to edit the actions tiddler instead of the button tiddler.

And thank you for making the example wiki with the button.

However, in the meantime I thought of another way of solving it. instead of adding some fields to the journal tiddlers from the start, I have put checkboxes in the text field, that add the exercised field with a "yes" value when checked (and other desired fields to track).
I am going to use this for counting how many days I exercise and do other habits. In addition, I have hidden these checkboxes with another checkbox that makes the field "log" when checked. This way I can count days where, log has "yes" and exercise is not "yes" (including non existing). This way I only count these fields for days I do log (no ambitions on weekends).

 <$checkbox field="log" checked="yes" unchecked="no" default="no">  Log</$checkbox>

<$reveal type="match" state="!!log" text="yes">

* <$checkbox field="exercise" checked="yes" unchecked="no" default="no">  trænede </$checkbox>
* <$checkbox field="meditation" checked="yes" unchecked="no" default="no"> mediterede</$checkbox>
* <$checkbox field="reading" checked="yes" unchecked="no" default="no"> læsning</$checkbox>
* <$checkbox field="project-work" checked="yes" unchecked="no" default="no"> projekt fremgang </$checkbox>
* <$checkbox field="journal" checked="yes" unchecked="no" default="no"> dagbog</$checkbox>
</$reveal>



But thank you for your help.

Reply all
Reply to author
Forward
0 new messages