[tw5] Stroll - Add Tag when creating new tiddler

Hello

Is anyone familiar with stroll here?

When clicking the ‘+’ button to “create a new tiddler that links to this one” it automatically creates a link in the new tiddler which is great but I am using the TableOfContents macro so I also need it to add a tag as well. How do I get it to automatically add a tag with the same name as the link it creates?

Thanks

1 Like

The tiddler you are looking for is titled $:/.giffmex/ViewToolbar/new-note-here it has the tags $:/giffmex/stroll and $:/tags/ViewToolbar. use advanced search the system tab to search for the tiddler.

When you have found it, you will have to open it for edit.

Insert the following:


\define button()
<$button tooltip={{$:/language/Buttons/NewHere/Hint}} class=<<tv-config-toolbar-class>> actions=<<actions>>>
{{$:/core/images/new-button}}
</$button>
\end

\define actions()
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<currentTiddler>> text="""[[$(tid)$]]"""/>
\end

<$wikify name=tid text=<<currentTiddler>>>
<<button>>
</$wikify>

Save and you should be good to go

1 Like

Hi!

This works great! but when there are spaces in the tiddler title then it creates a tag per word instead of one for all. How would this be fixed?

Thanks

No to worry. I worked it out

I added this line

<$set name=“tags” filter="[] [{$:/config/NewTiddler/Tags}]">

and changed <> to <>

This is the final code, please let me know if this is the correct way to do it.

\define button()
<$button tooltip={{$:/language/Buttons/NewHere/Hint}} class=<> actions=<>>
{{$:/core/images/new-button}}
</$button>
\end

\define actions()
<$set name=“tags” filter="[] [{$:/config/NewTiddler/Tags}]">
<$action-sendmessage $message=“tm-new-tiddler” title=<> tags=<> text=""“▴[[$(tid)$]]


”""/>
\end

<$wikify name=tid text=<>>
<>
</$wikify>