A Journal Book: Display Journal Tiddlers on a Monthly Basis

First backup and then test

  1. Download journal-book.json (3.1 KB)
  2. Drag and drop into your wiki contains several Journal tiddlers all tagged with Journal
  3. Open journal-book/example

How it works

  1. It uses filter to list years and months for them there is Journal
  2. It creates a tab row contains years, select a year to filter
  3. It creates a vertical tabs column to select a month in a year
  4. It then displays Journals for that month

A template is used to display each Journal journal-book/template modify it to meet your requirement. The example uses Kara plugin, but its optional

9 Likes

This is awesome and I have tried it.

It’s working well, but I’ve found that, using italian traslated ~TiddlyWiki the Tag Journal, embedded in the Macro must by changed to the Italian Translation “Diario”.

  • There is a more convenient way to have his automatically translated in the current used language of the Wiki?

In my case I have also modified the create date in date that is the field that I’m using due the fact that I’m re-building my old Travel Diary and che Create Date of the Tiddlewr is’nt the date of the day…

Last I’ve cloned journal-book() to journal-book-daily() and made some editing adding vertical-tab-daily() and journal-list-daily().

\define journal-book-daily()
<$list filter="[<stateTid>get[year]]" variable=null emptyMessage=<<initialize>> >

<<select-year>><<vertical-tab-daily>>
</$list>
\end

\define vertical-tab-daily()
<div class="kk-jb-container">
<$vars currentMonth={{{[<stateTid>get[month]] :else[subfilter<monthFilter>first[]] }}} >
<aside><<monthList>></aside>
<article>
<<journal-list-daily>>
</article>
</$vars>
</div>
\end

\define journal-list-daily()
<$vars month= {{{ [<stateTid>get[month]] }}} >
<!-- rimosso per lasciare spazio giorni, che già riportano la data
<b><$text text={{{ [<month>addsuffix[151200]format:date[MMM YYYY]]}}} /></b>
-->
<<tabs tabsList:"[tag[Diario]] :filter[get[date]prefix<month>] :and[sort[date]]" template:"journal-book/template-GG" buttonTemplate:"$:/mg/travelplan/Template/TTD-Tab-Button-GG" >>
</$vars>
\end
journal-book/template-GG
<$tiddler tiddler=<<currentTab>>>
''<$link><$view field="date" format=date template="DDD DD mmm YYYY"/></$link> - <$transclude field="caption" mode=inline/><br>''
<div class="tec-menu-list-item">
<$transclude mode=block/>
<<interstitial showInput:"no">>
</div>
</$tiddler>

$:/mg/travelplan/Template/TTD-Tab-Button-GG

<$tiddler tiddler=<<currentTab>>>
<!-- se è presente il campo data -->
<$list filter="[<currentTiddler>!has:[date]]">
<$view field=caption />
</$list>
<$view field=date format=date template="DD" />
</$tiddler>

Thank you for your work!

1 Like

@Mohammad I noticed that your macro has the tag Journal hardcoded into the code.

<$list filter="[tag[Journal]] :filter[get[created]prefix<month>] :and[sort[created]]" template="journal-book/template">

Ideally, it should read the $:/config/NewJournal/Tags entry and use it. For example, my journal entries are tagged 1 highlight. This change would make the plugin more robust.

Unfortunately, I do not know TW syntax enough to make this change myself. :slightly_frowning_face:

Thank you @talha131.
A similar comment raised by @Marco10x15.
I like your approach and I will add it. I also see how it can be used in multilingual environment.

I thought @Marco10x15 @talha131’s comments relevant and quite interesting.

Language is a virus!

When’s the international lingo dance? :slight_smile:

TT

$__plugins_kookma_thinkup_journalbook_macros.tid (2.3 KB)

This is a modified tiddler.

  1. You can view the difference here

  2. I decided to use journal-book macro from Mehregan

  3. It picks the list of tags from $:/config/NewJournal/Tags, thanks to @EricShulman splendid answer

  4. Instead of picking the date from created field of journals, it uses title.
    Now my journals’ have title format set to YYYY-0MM-0DD. So it worked for me.
    Not sure how it will work with other title formats. I did not test

1 Like

@Mohammad do you have this template available?

@talha131
I have shred this already! Look for grid css with my username! I will have a look in my folder when I get back to my desk! I am on the phone now!

1 Like

Ok. So this is causing a bug. format operator expects a UTC-date. YYYY-0MM-0DD is not a UTC date.

I need to dig a bit more deeper.

$__plugins_kookma_thinkup_journalbook_macros.tid (2.3 KB)

This version fixes the aforementioned bug.

If the journal title is ``YYYY-0MM-0DD`, the macro

  1. it removes -
  2. adds suffix 151200

These two steps convert the title of the journal to UTC. The macro then works perfectly.

Ideally, the macro should be smart enough to the title format from $:/config/NewJournal/Title and then parse UTC date out of it. But that opens a can of worms.

Perhaps this is why @Mohammad used the created field. It’s straight forward and simple.

In my case, some my journals have different created and title date so I was forced to read the date from the title.

Great work @Mohammad

For me however I would personally make use of a journal-date field allowing the title to be irrelevant, but this involves modifying new journal and new journal here buttons.

  • This allows one to set a journal date to other than when it was created eg; past or future dated
  • Your solution would still work if multiple Journal entry tiddlers were created each day (Need to test)

[Edited]

To add journal date edit $:/core/ui/Actions/new-journal and $:/core/ui/Buttons/new-journal-here to

  • add journal-date=<<now [UTC]YYYY0MM0DD0hh0mm0ss0XXX>> inside the (more than one) tm-new-tiddler actions.

@Mohammad Is there any way to display the content of the selected journal tiddler to the right side of the tiddler body similar what is shown here

Yes, It is just CSS. So the code function is the same, but the presentation is different.
As this solution is shared in the OP, feel free to do what you like with it.

8 posts were split to a new topic: How can Journal Book be modified to show a Calendar if a Month is clicked