How to make a button for creating new journal tiddler which will open in a modal instead of opening in the storyriver

I want to make a button for creating new journal tiddler which will open in a modal instead of opening in the storyriver. Is it possible?

Sure it is, Start with cloning the existing buttons, hide the old ones and redesign the buttons. You may also need to change the $:/core/ui/Actions/new-journal

You need to move away from using WidgetMessage: tm-new-tiddler
which by default

creates a new draft tiddler and adds it to the current story

  • That is navigates to the tiddler in edit mode.

And use the ActionCreateTiddlerWidget and not use an edit or navigate action but the tm-modal action.

1 Like
<$vars journalTitleTemplate={{$:/config/NewJournal/Title}} journalTags={{$:/config/NewJournal/Tags!!tags}} journalText={{$:/config/NewJournal/Text}}>
<$wikify name="journalTitle" text="""<$macrocall $name="now" format=<<journalTitleTemplate>>/>""">
<$action-createtiddler $basetitle=<<journalTitle>> tags="Journal" journal-date=<<now "YYYY0MM0DD0hh0mm0ss000">>>
<$action-sendmessage $message="tm-modal" $param=<<journalTitle>> />
Create a new Journal tiddler

I was able to create Journal tiddler using this code, but those tiddlers are not getting opened in the modal. How to pass on the title of the journal tidler to the tm-modal widget

1 Like

As far as I can see this is working somewhat, but since its an empty tiddler you don’t see anything in the modal, also if you click again rather than open the current one β€œ18th October 2022” you get a new tiddler β€œ18th October 2022 1”

A few Notes;

  • Journal-date modified to add 0xxx

Are you happy just to open the Journal Tiddler in the modal and not edit it? I was re-writing yours and Not actually sure of your objective.

I will write one how I imagine it and share in this reply.

<$wikify name="journalTitle" text="""<$macrocall $name="now" format={{$:/config/NewJournal/Title}}/>""">
<$list filter="[<journalTitle>!has[title]]" variable=~ emptyMessage="""<$action-sendmessage $message="tm-modal" $param=<<journalTitle>> />""">
<$action-createtiddler $basetitle=<<journalTitle>> tags={{$:/config/NewJournal/Tags!!tags}} journal-date={{{ [<now YYYY0MM0DD0hh0mm0ss0xxx>] }}} text={{$:/config/NewJournal/Text}} >
<$action-sendmessage $message="tm-modal" $param=<<journalTitle>> />
  • Note I only Wikify <<journalTitle>> so I can selectively use it to create the tiddler, only if it does not exist, otherwise open the modal.
  • Tomorrow a new one will be created.
  • I closed the wikify widget - for safety should I decide to code more.
  • Usualy a modal is a different Template tiddler, rather than the end result.
    • Perhaps a modal which you can view or edit todays journal tiddler is another approach?

I have to study your code and will reply in a few days.
The main purpose of this is to create Home tiddler for my wiki for quickcapture in mobile. I will create a tiddler with a table having certain buttons to open forms, trackers in a modal window so that I can access everything which require quick capture in single home tiddler. This button to open the Journal tiddler was also for the same purpose.

Another idea which comes to my mind is navigating the tiddlers corresponding to each of those buttons within the same modal window iteslf without closing and opening the modal each time. I havent seen such an implementation yet. So that will remain as just an idea for the time being.

Edit: Saq's Sandbox β€” Experimental doodads Here I am seeing a similar implementation (although not using a modal), but it might be difficult to implement.

Edit 2: I think if I try this example , there is some chances of making it work.