Simplest possible comment button

73 views
Skip to first unread message

Joe Armstrong

unread,
Jan 10, 2019, 12:40:43 PM1/10/19
to TiddlyWiki
I want to make the simplest possible comment system - to allow me to add comments to a tiddler

Adding this button to a tiddler makes a new tiddler with a unique name when I click it

<$button>
  <$action-createtiddler 
     $basetitle="comment"
     role="comment" 
      parent=<<currentTiddler>>
 /> Click to make a comment
</$button>

When I click I get a new tiddler with a unique name and fields role and parent
so I'll be able to search and find all comments later.

My problem is that after creation the new tiddler is closed - is there a way to display it and open it immediately for editing?

Note: I'm not interested in formatting this nicely with CSS nor attaching the comments and buttons
to the parent tiddler - these are separate problems.

Cheers

/Joe

TonyM

unread,
Jan 10, 2019, 4:41:07 PM1/10/19
to TiddlyWiki
Joe,

Add an additional action to your button 
<$action-navigate $to="ButtonWidget"/>

Changing $to to the Tiddler in Question, because you are using action-createtiddler to create the tiddler you can set $savetitle="$:/temp/temptitle" and get the resulting title from there. Eg "commment 1". 
Such as <$action-navigate $to={{$:/temp/temptitle}}/>

A Quick FYI since you are working with Comments, Have you used the new comment plugin?

Control Panel > Plugins > Get More Plugins > Open Public Library > Locate "Comments" > Install > Reload

Regards
Tony

Joe Armstrong

unread,
Jan 10, 2019, 5:04:32 PM1/10/19
to TiddlyWiki
Brilliant thanks a lot !!!

It now looks like this:

<$button>
  <$action-createtiddler 
      $basetitle="comment"
      $savetitle="$:/temp/commentName"
      relationship="comment" 
      parent=<<currentTiddler>> /> 
   <$action-navigate 
       $to= {{$:/temp/commentName}} />
    Click to make a comment
</$button>

Is this the *simplest* solution?

Cheers

/Joe

Joe Armstrong

unread,
Jan 10, 2019, 5:06:54 PM1/10/19
to TiddlyWiki
And yes I have been staring hard at the code in the comment plugin - trying to reduce it to
its simplest elements.

/Joe
Enter code here...



On Thursday, 10 January 2019 22:41:07 UTC+1, TonyM wrote:
Reply all
Reply to author
Forward
0 new messages