How to use a tag with spaces in tm-new-tiddler message?

149 views
Skip to first unread message

talha131

unread,
Oct 10, 2020, 12:49:53 PM10/10/20
to TiddlyWiki
I want to use send message to create a tiddler with a tag. Tag must have two words separate by space, for example "hello world"

I tried

```html
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags="hello world"  text={{{ [<journalTitle>get[]] }}}/>
```

But the tiddler it makes has two tags, "hello" and "world" instead of one "hello world".

What syntax should I use so that the new tiddler has the proper tag?

Atronoush Parsi

unread,
Oct 10, 2020, 12:57:32 PM10/10/20
to tiddl...@googlegroups.com
The tags field shall be handled like this 

tags="tag1 tag2 [[tag with space]]"

--Atro

--
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/989a7947-37ee-4e25-a75a-1ca3208efdc6o%40googlegroups.com.

talha131

unread,
Oct 10, 2020, 1:05:22 PM10/10/20
to TiddlyWiki

Thank you. This worked.

But what syntax should I use if the tag is defined inside a variable journalTags.

I have tried

tags="[[<<journalTags>>]]""

and

tags="[[$journalTags$]]""

Both did not work.

Atronoush Parsi

unread,
Oct 10, 2020, 1:11:45 PM10/10/20
to tiddl...@googlegroups.com
You should use tags=<<journalTags>>
 If you gonna to concatenate journalTags with some other tags like tag1, tag2, ... then use a macro to first concatenate and then use them.

If you still have a problem, send a simplified code and I will have a look.

--
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.

talha131

unread,
Oct 10, 2020, 1:44:43 PM10/10/20
to TiddlyWiki

Thanks a lot. I am actually trying to create a duplicate of “New Journal” button, which I call “New Highlight”. Everything now works including the keyboard shortcut.

What does not work is that I want the “New Highlight” tiddler to have a tag ✨ highlight. Notice the space.

The code for the action is this

<$vars journalTitleTemplate={{$:/talha131/config/NewHighlight/Title}} journalTags={{$:/talha131/config/NewHighlight/Tags}} journalText={{$:/talha131/config/NewHighlight/Text}}>
<$wikify name="journalTitle" text="""<$macrocall $name="now" format=<<journalTitleTemplate>>/>""">
<$reveal type="nomatch" state=<<journalTitle>> text="">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<journalTags>>  text={{{ [<journalTitle>get[]] }}}/>
</$reveal>
<$reveal type="match" state=<<journalTitle>> text="">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<journalTags>> text=<<journalText>>/>
</$reveal>
</$wikify>
</$vars>

As you can tell it is same as new-journal action.

It reads the tag from {{$:/talha131/config/NewHighlight/Tags}} into journalTags variable.

This variable is used in this way tags=<<journalTags>>. But this syntax does not work for a tag that has spaces in it.

You can try this issue, by overwriting your $:/config/NewJournal/Tags tiddler and adding a tag that has spaces in it.

talha131

unread,
Oct 10, 2020, 1:47:48 PM10/10/20
to TiddlyWiki

I just tried setting the value of my tiddler $:/talha131/config/NewHighlight/Tags

[[✨ highlight]]

and it solved the issue.

But I would still like to know how to use spaces in tags=<<journalTags>> syntax?

Atronoush Parsi

unread,
Oct 10, 2020, 3:00:41 PM10/10/20
to tiddl...@googlegroups.com
Talha,
 Your code works for me! You have used
<$vars journalTitleTemplate={{$:/talha131/config/NewHighlight/Title}} journalTags={{$:/talha131/config/NewHighlight/Tags}} journalText={{$:/talha131/config/NewHighlight/Text}}> 

If  tags in journalTags tiddler are stored as below
tag1 tag2 [[tag with space]] [[ highlight]]

Your code will work!

--Atro


--
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.

TW Tones

unread,
Oct 10, 2020, 4:25:21 PM10/10/20
to TiddlyWiki
Talha,

If you want to provide a tag with a space it is as simple as providing it in the correct format tags="[[hello world]] anothertag", of note is this is what we call a title (format). This is necessary otherwise we could not add the two tags hello AND world if this was not so.

If you want to compute this value somehow, possibly the best trick is to use the triple braces "filtered transclusion" 
tags={{{filter}}}

This is because the filter will be evaluated and provide the value of the parameter so you could use {{{ [all]current]] [{!!status}] [[Hello World]] }}} to tag it with the current tiddler (with or without spaces AND the value of the current tiddler status field and "Hello World".
This is because filters are primarily about evaluating titles.

Tones
Reply all
Reply to author
Forward
0 new messages