<$action-listops>: Actual title instead of draft title?

85 views
Skip to first unread message

leeand00

unread,
Apr 12, 2020, 12:14:16 PM4/12/20
to TiddlyWiki
This code works great for populating the caption, order and tooltip fields at the click of a button; but I always end up with the draft title instead of the title of the tiddler in the field I end up with the draft title; is there anyway to fix that?

<$button>
   <$set name="cap_ord" value="4">
     <$action-listops $field="caption" $subfilter=<<cap_ord>> />
     <$action-listops $field="tooltip" $subfilter=<<currentTiddler>> />
     <$action-listops $field="order" $subfilter=<<cap_ord>> />
  </$set>
   Populate 'fields'
</$button>

Mark S.

unread,
Apr 12, 2020, 12:31:50 PM4/12/20
to TiddlyWiki

Is this a button you've added to your edit template? Because it works fine when used from a standard tiddler.

PMario

unread,
Apr 13, 2020, 1:44:01 PM4/13/20
to TiddlyWiki
Hi,

A draft tiddler has 2 additional fields:
eg:

"draft.of": "New Tiddler"    ... Name of the tiddler which is edited
"draft.title": "asdf" ... new name of the tiddler if you want to rename it.

You can use those 2 fields to get what you want. ... without the quotes ;)

-m

PMario

unread,
Apr 13, 2020, 1:45:28 PM4/13/20
to TiddlyWiki

Mat

unread,
Apr 13, 2020, 1:57:39 PM4/13/20
to TiddlyWiki
PMario wrote:
"draft.of": "New Tiddler"    ... Name of the tiddler which is edited
"draft.title": "asdf" ... new name of the tiddler if you want to rename it.

You can use those 2 fields to get what you want. ... without the quotes ;)


Heeeey! That's clever! Thanks PMario!

<:-) 

Mat

unread,
Apr 13, 2020, 2:04:41 PM4/13/20
to TiddlyWiki
@leeand00

Hope you're not trying out your button while in editmode, in the preview section, and this causes the Draft title to end up there. :-)

Also, minor, but you can use <$vars cap_ord=4> instead of $set etc.

<:-)

leeand00

unread,
Apr 15, 2020, 12:38:37 PM4/15/20
to TiddlyWiki
Thank you Mario!
Reply all
Reply to author
Forward
0 new messages