[Request] New here but without parent's tags

136 views
Skip to first unread message

David Gifford

unread,
Nov 28, 2020, 9:36:11 AM11/28/20
to TiddlyWiki
Hi everyone!

Below is the snippet for my "New tab here" button. It creates a new tiddler, with the title of the parent tiddler as the title and the tag of the child tiddler. A tabs macro in the parent tiddler displays the children tiddlers as tabs.

The only problem I have is that the child tiddlers inherit the tags of the parent. I would like for that behavior to stop.

What do I need to delete, add or change for that to happen? I tried various things but nothing worked. I appreciate any help I can get. Blessings.

\whitespace trim
\define newHereActions()
<$set name="tags" filter="[<currentTiddler>] [{$:/config/NewTiddler/Tags!!tags}]">
<$action-sendmessage $message="tm-new-tiddler" $param=<<currentTiddler>> tags="" tags=<<tags>> text="* " caption="" meta="note"/>
</$set>
\end
\define newHereButton()
<$button actions=<<newHereActions>> tooltip={{$:/language/Buttons/NewHere/Hint}} aria-label={{$:/language/Buttons/NewHere/Caption}} class=<<tv-config-toolbar-class>>>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/core/images/folder}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/NewHere/Caption}}/>
</span>
</$list>
</$button>
\end
<<newHereButton>>

clutterstack

unread,
Nov 28, 2020, 4:16:37 PM11/28/20
to TiddlyWiki
Hi David,

Looks like you are using the tm-new-tiddler message using the original tiddler as a template ("$param"), and need to change it to use a title parameter instead: https://tiddlywiki.com/#WidgetMessage%3A%20tm-new-tiddler

Best,
Chris

clutterstack

unread,
Nov 28, 2020, 4:20:59 PM11/28/20
to TiddlyWiki
Now I'm trying that, and wondering if it might be easier to create the tiddler the way you did, and then just remove the superfluous tags with action-listops...

But many others here would know off the bat the best way to increment the title; I'd have to look into it.

Best,
Chris

clutterstack

unread,
Nov 28, 2020, 4:27:10 PM11/28/20
to TiddlyWiki
...action-createtiddler, tm-navigate message, and then tm-edit-tiddler?

I'm curious to see the "right" answer to this. :)

clutterstack

unread,
Nov 28, 2020, 9:43:10 PM11/28/20
to TiddlyWiki
OK, how about this for the button actions? Usual disclaimers about backing up data!

\define newHereActions()
<$set name="tags" filter="[<currentTiddler>] [{$:/config/NewTiddler/Tags!!tags}]">
<$action-createtiddler $basetitle=<<currentTiddler>> $savetitle=!!latestHere tags=<<tags>> text="* " caption="" meta="note"/><$action-navigate $to={{!!latestHere}}/><$action-sendmessage $message=tm-edit-tiddler $param={{!!latestHere}}/><$action-setfield $field=latestHere/>
</$set>
\end

I didn't get tm-navigate to work with a brief effort, but action-navigate seems good. In fact, the whole thing seems to work if I omit action-navigate, but control over the location in the Story may make it worth keeping. The final action-setfield deletes the !!latestHere field used to store the new tiddler's title for the use of the newHereActions.

I wonder if there's a cleaner way.

Best,
Chris

TW Tones

unread,
Nov 29, 2020, 9:26:04 PM11/29/20
to TiddlyWiki
David,

When creating the new tiddler you have the parameter  tags=<<tags>>  so no wonder it inherits the tags. 
Perhaps change it to tags=<<currentTiddler>> ?

Tones

Eric Shulman

unread,
Nov 29, 2020, 9:41:52 PM11/29/20
to TiddlyWiki
On Sunday, November 29, 2020 at 6:26:04 PM UTC-8 TW Tones wrote:
When creating the new tiddler you have the parameter  tags=<<tags>>  so no wonder it inherits the tags. 
Perhaps change it to tags=<<currentTiddler>> ?

The value of <<tags>> doesn't come from the current tiddler.  His code constructs the desired tags this way:
<$set name="tags" filter="[<currentTiddler>] [{$:/config/NewTiddler/Tags!!tags}]">

The problem originates with $param=<<currentTiddler>> , which uses the current tiddler as the *template*, which causes the tags to be inherited.

-e

David Gifford

unread,
Nov 30, 2020, 8:17:45 AM11/30/20
to tiddl...@googlegroups.com
clutterstack, I would like to try this out, but it looks like everything is inside the define / end. Is there a button I have to put after the /end? Or does the /end need to move up somewhere?


--
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/cDtOKYupbnI/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/4e20398c-2655-4012-b232-9e2c2bc80772n%40googlegroups.com.

David Gifford

unread,
Nov 30, 2020, 8:28:48 AM11/30/20
to tiddl...@googlegroups.com
Hi clutterstack

I tried it, but...no, no buts, it worked like a charm!

Thanks a bunch!


On Sat, Nov 28, 2020 at 8:43 PM clutterstack <bee...@gmail.com> wrote:
--

clutterstack

unread,
Nov 30, 2020, 10:10:15 AM11/30/20
to TiddlyWiki
David, it's great to hear that it works for you. You're very welcome. Your TW contributions have informed and inspired me for many years! I was also pleased finally to be able to offer a working answer to someone's question on here, even if I don't have the confidence to say it's the best way.

Sorry I wasn't clear enough about exactly what I had included in my reply. Looks like you sorted it out though.

Best,
Chris

TW Tones

unread,
Nov 30, 2020, 7:27:06 PM11/30/20
to TiddlyWiki
Chris,

The best way to learn can be to teach :)

Tones
Reply all
Reply to author
Forward
0 new messages