Hi everyone,

I'm trying to create a button based on the "new journal here" which would work even if the current tiddler is in edit mode. I can obtain the real title of the tiddler with:

<$list filter="[all[current]get[draft.of]]" emptyMessage={{!!title}} />

but I didn't find how to pass the result to the "tags" parameter in the action-sendmessage widget. I assume that I need to obtain the result as a string before transmitting it as a parameter, but I'm confused about when a macro or widget is actually evaluated. (I also tried using "macrocall" but probably not the right way)

This is what I have currently:

\define nonDraftTitle()
  <$list filter="[all[current]get[draft.of]]" emptyMessage={{!!title}} />
\end

\define evalNonDraftTitle()
  <$macrocall $name=nonDraftTitle/>
\end

\define journalButton()
  <$button
    tooltip={{$:/language/Buttons/NewJournalHere/Hint}}
    aria-label={{$:/language/Buttons/NewJournalHere/Caption}}
    class=<<tv-config-toolbar-class>>
  >
  <$action-sendmessage
    $message="tm-new-tiddler"
    title=<<now "$(journalTitleTemplate)$">>
    tags=<<nonDraftTitle>>
  />
  <$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
    {{$:/core/images/new-journal-button}}
  </$list>
  <$list filter="[<tv-config-toolbar-text>prefix[yes]]">
    <span class="tc-btn-text">
      <$text text={{$:/language/Buttons/NewJournalHere/Caption}}/>
    </span>
  </$list>
</$button>
\end

<$set name="currentTiddlerTag" value=<<evalNonDraftTitle>>>
  <<evalNonDraftTitle>>      <!-- debug -->
  <<journalButton>>
</$set>


Thank you!
Erwan

--
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

Reply via email to