Alternative use for Journal

I am using the Tiddly wiki to keep an “in game” journal for my roleplay group, it isn’t helpful when it only ever takes the “real” date, I had a quick look to see if I could re-purpose the journal button, but I quickly became aware I was out of my depth.

What I need is a button that will create a new tiddler, that tiddler should have a “startdate” field (and an “enddate” field to allow me to have travel montages and stuff like that,) the startdate of the new tiddler should be the largest existing enddate +1 and the title should be something like “Day 56” where 56 is the startdate. (new tiddler startdate = enddate)

I would also want a list tiddler that sorted them in reverse order so the largest start date is at the top, but I think I should be able to manage that once I have some tiddlers and with some time spent beating tiddly wiki into submission.

give this a go:

<$button class="tc-btn-invisible" actions="""
<$let sdate={{{[tag[journal]get[enddate]maxall[]else[0]add[1]]}}}>

<$action-sendmessage 
   $message="tm-new-tiddler" 
   $param={{{[[Day ]addsuffix<sdate>]}}}
   tags=journal
   startdate=<<sdate>>
   enddate=<<sdate>>
/>

</$let>
""">
{{$:/core/images/new-journal-button}}
</$button>

you should be able to paste that into a tiddler and get the button. let me know if you have any questions :slight_smile:

1 Like

ok, so I have three tiddlers;

$:/config/PageControlButtons/Visibility/newInGameDayAction which has a contents of “show”

newInGameDayAction with a contents of what you said above (Tagged with $:/tags/PageControls and has a caption and description field that look like they are working)

and that button then shows on the bar next to the drop down.

I also made a tiddler called Day 0 with a startdate of 0 and enddate of 0

but when I click the button, nothing happens.

I have tagged all three with “buttonTest” and you can find the wiki here http://rathma.eaglesroost.org/

Any idea’s what I am doing wrong, I suspect it is something stupid knowing me

You have two small errors in newInGameDayAction:

  • The $let widget was added in TW v5.2.1, but you are using TW v5.1.23. Thus, the $button action triggers an “undefined widget” error. Either use the older $vars widget instead of $let, or upgrade to the current TWCore (v5.3.3).
  • The filtered transclusion to calculate sdate uses [tag[journal].... However, your “Day 0” tiddler is tagged with Journal (note the capitalization!). You should also use the capitalized tag value when creating the new tiddler, like this:
<$vars sdate={{{ [tag[Journal]get[enddate]maxall[]else[0]add[1]] }}}>
...
   tags=Journal
...
</$vars>

enjoy,
-e

2 Likes

You are both Wonderful!!! Thankyou so much!

1 Like