Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong this.editTitle in a section #22

Open
linonetwo opened this issue Jan 18, 2022 · 5 comments
Open

Wrong this.editTitle in a section #22

linonetwo opened this issue Jan 18, 2022 · 5 comments

Comments

@linonetwo
Copy link

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
Copy link
Author

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

@linonetwo
Copy link
Author

@linonetwo
Copy link
Author

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
Copy link
Author

linonetwo commented Jan 18, 2022

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
Copy link
Owner

kookma commented Jan 19, 2022

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants