On Monday, May 17, 2021 at 11:08:35 AM UTC+2 vpl wrote:
I try to invokea macro that reset tiddler fields when we open it. By opening I do not mean for editing, I mean the tiddler is invoked via a link for example
hmmmm, You should have highlighted the _not_ ... I did only see/read for editing.
I do have a widget, which is called <$trigger actions=<<anyAction>> /> ... It is "triggered" whenever the widget is rendered or re-rendered. ...
So it has some potential to completely brick your wiki, if done wrong. ...
The risk to loose data is especially high, while developing the action-code and the "preview pane" is active. Because <$action-setfield .. with wrong parameters can completely ruin tiddler content. ... So be warned .... BACKUP - BACKUP - BACKUP
There is no documentation yet. So you have to open the tiddlers in the link, to see what's going on.
I would implement the development code like this:
title: myFooter
tags: $:/tags/ViewTemplate
<$list filter="[all[current]tag[test]]">
<$trigger actions= ...../>
</$list>
So you can use the tag: test to switch the action on / off.
have fun!
mario
PS: Be sure to
BACKUP - BACKUP - BACKUP
PPS: The preview-pane will trigger the actions!!!