TW-Section icon indicating copy to clipboard operation
TW-Section copied to clipboard

Wrong this.editTitle in a section

Open linonetwo opened this issue 4 years ago • 5 comments

We have a fishing plugin https://github.com/oflg/fishing that you may know. We use this.editTitle to get current article tiddler's title, and add the a article title as tag for the flashcard.

But currently, in a section, the this.editTitle will be wrong, seem to be changed to the first line section?

linonetwo avatar Jan 18 '22 04:01 linonetwo

I hope I can add article's title as tag, but instead a temporary title is used.

linonetwo avatar Jan 18 '22 05:01 linonetwo

linonetwo avatar Jan 18 '22 05:01 linonetwo

I think one way is to let the temp content tiddler have same draft.title and tags and all other fields, as the original tiddler.

linonetwo avatar Jan 18 '22 05:01 linonetwo

Maybe change

\define editActions()
<!-- action when edit button is clicked -->
<$action-setfield $tiddler=<<stateTid>> $index=<<counter>> $value="edit" />
<$action-setfield $tiddler=<<editTid>> $field=text $value=<<currentSection>> />
\end

to something like this

\define editActions()
<!-- action when edit button is clicked -->
<$action-setfield $tiddler=<<stateTid>> $index=<<counter>> $value="edit" />
<$action-setfield $tiddler=<<editTid>> $field=text $value=<<currentSection>> />

<$action-setfield $tiddler=<<editTid>> $field=draft.title $value={{{ [<currentSection>get[title]] }}} />
<$action-setfield $tiddler=<<editTid>> $field=tags $value={{{ [<currentSection>get[tags]] }}} />
\end

Don't know how to do <<currentSection!!title>>, Gk0Wk said I can use {{{ [<currentSection>get[title]] }}

linonetwo avatar Jan 18 '22 05:01 linonetwo

I have commented on the PR!

Don't know how to do <<currentSection!!title>>, Gk0Wk said I can use {{{ [<currentSection>get[title]] }} Yes that is correct!

kookma avatar Jan 19 '22 05:01 kookma