kookma / TW-Section

create, edit and manage big and lengthy tiddlers through sectioning
https://kookma.github.io/TW-Section/
MIT License
26 stars 3 forks source link

Wrong this.editTitle in a section #22

Open linonetwo opened 2 years ago

linonetwo commented 2 years ago

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 commented 2 years ago

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

linonetwo commented 2 years ago

linonetwo commented 2 years ago

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 commented 2 years ago

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]] }}

kookma commented 2 years ago

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!