writing to tiddlers?

69 views
Skip to first unread message

Jean-Pierre Rivière

unread,
Oct 26, 2020, 6:42:05 PM10/26/20
to TiddlyWiki
I my wiki, I have often forgotten to put the type as tw5 wikitext. I have not been able to set this as the default type BTW (any idea?)

I can list all such relevant tiddlers with:

<$list filter="[field:type[]!prefix[$:/]]"> %% <$link/></$list>

and then correct them all manually. Could I manage to do it automatically? Perhaps passing by a button an,d an activation mechanism would help?

Atronoush Parsi

unread,
Oct 26, 2020, 11:49:42 PM10/26/20
to tiddl...@googlegroups.com
Use Commander to do this automatically for you!

--
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/c1dc62a2-b739-4605-9fd9-35fc5d5498b6n%40googlegroups.com.

TW Tones

unread,
Oct 27, 2020, 12:37:52 AM10/27/20
to TiddlyWiki
Jean-Pierre,

The default if the type setting is not set is text/vnd.tiddlywiki so you do not need to set it.

if your need "type" for some other reason you can "assume"  this value if blank

{{{ [all[current]get[type]] ~[[text/vnd.tiddlywiki]] }}}

However one of the most powerful methods you can learn in tiddlywiki is a button is a trigger and actions are triggered.
The following is not tested and done from memory please make a copy of your wiki before testing.

\define action-s()
Action widgets here
\end
<$button actions=<<action-s>
<<actions>>
button title
</$button>
  • The above acts on the current tiddler if relevant
  • But you can use wiki text inside buttons or actions, the parameter version "actions=<<macro containing actions>>" is the recommended one.
  • You could wrap the above in a list to create a button for each tiddler
However when reformatting tiddlers, doing bulk actions we do this
<$button>
<$list filter="tiddler-filter">>
"actions"
</$list>
button title
</$button>

To change all blank type fields to
<$button>
<$list filter="[!is[system]get[type]is[blank]]">
<$action-setfield type="text/vnd.tiddlywiki"/>
</$list>
button title
</$button>
Warning be selective what you change, if you changes system tiddlers you may overwrite every system tiddler.


I still do know what you need to do this give that is the default type but the above allows you do do anything with one button click you can achieve with action macros or send message and the messages and wiki text to prepare them. 

See https://tiddlywiki.com/#FieldManglerWidget for four messages that require use of the fieldmangler widget as well.

Finally modify the new tiddler button or create your own to set the type every time you create a tiddler. But this is not necessary.
 
Feel free to ask more questions.

Tones
Reply all
Reply to author
Forward
0 new messages