Question re edit toolbar buttons and inserting text from fields

58 views
Skip to first unread message

David Gifford

unread,
Aug 30, 2019, 9:27:38 AM8/30/19
to TiddlyWiki
Hi all

I am trying to combine steps but I can't wrap my head around it.

I would like an editor toolbar button that does three things:

1. Inserts outer text A
2. Grabs and inserts as text the contents of a special field of the current tiddler
3. Inserts outer text B

I want the final result to look like

<dt></dt><dd>

<span class="source">- resumen de Lee, M. E., 2017 'Sound Mapping', p. </span>

</dd><hr>

But where

Lee, M. E., 2017 'Sound Mapping'

is the contents of the source field of the tiddler I am working in, and everything before and after wraps around it.

I am getting stamps and buttons and filters and macros all scrambled in my brain.

The solutions I have come up with always end up inserting the {{ "[[]]" }} or whatever else I use to access the contents of the field. But I want to insert the actual content of the field as text, so when I transfer the above to another tiddler, it will retain the source from the first tiddler rather than looking for the source field of the new tiddler.

The use case is for taking notes in a tiddler representing a book. Each note is wrapped with the definition list line, and the source is added automatically at the end of the note. Then I manually transfer the content, definition list tags and all, to a tiddler (in another Tiddlywiki) representing a topic that the note is about. That way I take notes by book but organize notes by topic for publishing in definition lists. Then I export as static and the end result looks like this http://articulos.giffmex.org/evangelios/genero.html.

My current process is A) an editor toolbar button to insert the definition list, then B) a separate stamp to insert the contents of a 'source' tiddler, and C) change the source tiddler every time I switch between books. Instead, I would like to just create the book tiddler, add the source data for the book into a source field of that tiddler, then click an editor toolbar button once each time I add a new note, without having to repeat steps B and C.

Thanks in advance to anyone who has the time and patience to walk me through this.

Aidan Grey

unread,
Aug 30, 2019, 11:05:48 AM8/30/19
to TiddlyWiki

Have you tried {{!!source}}?

This is how I'd do it, as a stamp.


<$action-sendmessage
	$message="tm-edit-text-operation"
	$param="replace-selection"
	text="""
		<dt></dt><dd>
<span class="source">- {{!!source}} 'Sound Mapping', p. </span>
</dd><hr>
""" />

David Gifford

unread,
Aug 30, 2019, 1:16:17 PM8/30/19
to TiddlyWiki
Hi Aiden

Thanks for the effort. But this is the problem: it stamps {{!!source}} instead of stamping the contents of the source field. So when I copy and paste this to another tiddler, it will show as whatever is in the source field of that tiddler. I need something that stamps the field content as text.

Dave

Aidan Grey

unread,
Aug 30, 2019, 1:20:09 PM8/30/19
to tiddl...@googlegroups.com
I'm not sure i understand. It should say {{!!source}} in edit mode, but when you save the tiddler, it should show the content of the source field. It's not doing that?

--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/278e641c-b676-48a2-b170-bb138bd0b54c%40googlegroups.com.

David Gifford

unread,
Aug 30, 2019, 2:02:36 PM8/30/19
to tiddl...@googlegroups.com
Hi Aiden

Perhaps my original post wasn't clear enough.

You are correct that stamping what you gave me will SHOW the contents of the source field of the current tiddler. But if I copy and paste that note in another tiddler in a totally different file, it will unfortunately show the contents of the source field of the new tiddler, not the original one. So I will lose data upon transfer. I want something that grabs the content of the source field of the original tiddler and stamps it as TEXT, not stamping stuff like {{}}.

Thanks again,

David Gifford

You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/OuLEMedFbL4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/CAJu7H0bmfZcD3F5hyNwjYW5nvmBYiL2%2Bht7xiketu7evzONsXA%40mail.gmail.com.

Aidan Grey

unread,
Aug 30, 2019, 2:22:26 PM8/30/19
to tiddl...@googlegroups.com
Ah! I see now.

I think you'll have to (get someone to) write a plugin for that. I could be wrong though... Maybe someone else here knows.

Reply all
Reply to author
Forward
0 new messages