How to inherit tags when creating a new tiddler?

83 views
Skip to first unread message

Pedro

unread,
Oct 18, 2020, 4:09:05 PM10/18/20
to tiddl...@googlegroups.com
Hi,

I'm trying to implement a different behavior on my tiddly wiki instance. It's a research diary and I have many macros that index different subjects by tags. So, when I create a new tiddler linked to an existing one (so, using the button "create a new tiddler that links to this one"), I would like that it have the same set of tags than the original one.

I have no idea how to implement it! Can anyone give me some directions?


----------
Pedro Alves

PhD candidate in Computer Science
Institute of Computing - University of Campinas

TW Tones

unread,
Oct 18, 2020, 6:14:26 PM10/18/20
to TiddlyWiki
Pedro,

Have you tried the clone button?, Clone and edit is a quick way to achieve this. But it is also easy to build custom buttons.

If you want a custom button you can clone or edit the New Here Button 

$:/core/ui/Buttons/new-here

Then modify it to get the behaviour you want.

Eg in the actions tags={{!!tags}}

Regards
Tones

Pedro

unread,
Oct 19, 2020, 6:49:56 AM10/19/20
to tiddl...@googlegroups.com
Hi Tones,

Thanks for the hint. I didn't know the clone button and it surely may help sometimes but it seems that custom buttons will better fit my needs.
I was successful in customizing the new-here button. I cloned it, named the new version as custom-new-here, and inserted tags={{!!tags}} in its actions. It works perfectly. When I create a new tiddler using the custom-new-here button it is created with its "parent tiddler" tags.

To replicate this behavior on new-journal-here I had to define a new value named inheritedTags

<$set name="inheritedTags" value={{!!tags}}>

and modify the definition of journalButtonTags() to get it

\define journalButtonTags()
$(journalTags)$ $(inheritedTags)$
\end

I removed the reference to [[$(currentTiddlerTag)$]] since I'm not interested in the name as a tag.

Thank you Tones =)
----------
Pedro Alves

PhD candidate in Computer Science
Institute of Computing - University of Campinas

--
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/0263ab93-7296-48c1-a80b-70f58abd2848o%40googlegroups.com.

PMario

unread,
Oct 19, 2020, 7:50:17 AM10/19/20
to TiddlyWiki
Hi Pedro,

 - You can use the "Clone" button,
 - Give it a new name
 - Go to the text field
   - CTRL-A
   - backspace
Done!

All your tags are there and the text field is overwritten.

Just an idea, that doesn't need any tweaking and works out of the box for every TW.

-mario

PMario

unread,
Oct 19, 2020, 7:51:40 AM10/19/20
to TiddlyWiki
Hi,

You can use: https://tiddlywiki.com/index.html#ActionCreateTiddlerWidget and have a closer look at example 4 and 5

have fun!
mario
Reply all
Reply to author
Forward
0 new messages