saqimtiaz / streams

TiddlyWiki plugin for rapid data entry with a keyboard driven workflow. Divide content into smaller tiddlers as you write.
BSD 3-Clause "New" or "Revised" License
58 stars 6 forks source link

How to return current node title #4

Closed postkevone closed 4 years ago

postkevone commented 4 years ago

I want to return the current node title in the same way <stream-root-title> returns the title of the current tiddler, how can I do it?

saqimtiaz commented 4 years ago

@kebifurai inside a node, <<currentTiddler>> points to the node and not the story tiddler.

You can also access the immediate parent via {{!!parent}} and the storyTiddler (root node) via <<stream-root-title>>

postkevone commented 4 years ago

Sorry, I didn't use the code block in the question. So something like <node-title> doesn't exist, right?

saqimtiaz commented 4 years ago

@kebifurai apologies, I've corrected the above comment. Inside a node, <<currentTiddler>> will give you the node title.

postkevone commented 4 years ago

Thank you for the fast reply!

postkevone commented 4 years ago

Sorry to reopen but how do I recall the title of a node outside that node? <<currentTiddler>> returns the title of the note where my macro is defined not the actual node, but <<stream-root-title>> works just fine, what am I missing...

saqimtiaz commented 4 years ago

Sorry to reopen but how do I recall the title of a node outside that node?

I don't understand what this means or what you are attempting to do.

<<currentTiddler>> returns the title of the note where my macro is defined not the actual node, but <<stream-root-title>> works just fine, what am I missing...

This seems related to your code and how it is being used within Streams, most likely you are re-assigning currentTiddler to a different value in your macro. I cannot offer further assistance without seeing your code.

postkevone commented 4 years ago

I'm using Stream in combination with another plugin TiddlyRemember

TiddlyRemember also uses an ID field generated from the current time, the same way Stream does. TiddlyRemember has the following macro:

$:/plugins/sobjornstad/TiddlyRemember/toolbar/remembercz

\define getMacro()
<<remembercz "$(clozeid)$"
    "Cloze">>
\end

<$set name=clozeid
      value=<<now "[UTC]YYYY0MM0DD0hh0mm0ss0XXX">> >
    <$action-sendmessage
        $message="tm-edit-text-operation"
        $param="replace-selection"
        text=<<getMacro>>
    />
</$set>

I want to change the clozeid value to the node-title because it already contains a generated ID. I tried to use <<currentTiddler>> instead of <<now "[UTC]YYYY0MM0DD0hh0mm0ss0XXX">> but when I recall this toolbar with a shortcut, it returns $:/plugins/sobjornstad/TiddlyRemember/toolbar/remembercz instead of the node title.

saqimtiaz commented 4 years ago

This isn't an issue related to Streams, but rather to TiddlyRemember.

Trying to make TiddlyRemember use the currentTiddler variable in a regular tiddler (not a Streams node) causes the same issue. Try using the targetTiddler variable set by the code that setups the edit toolbar.

If that doesn't help, I suggest posting on the google group and asking for assistance.