Create tiddler from Select widget

62 views
Skip to first unread message

mohamed maghrabi

unread,
Jan 19, 2022, 12:21:01 PM1/19/22
to TiddlyWiki
Hi,

Is is possible to incorporate a create new tiddler action with a select widget

so if i have something like this , 

Status  <$select
field="status"…>
<option>Pending/Blocked</option>
<option>With Vendor</option>
<option>In House</option>

how can i make one of the choices trigger this 

</$select>
<$action-createtiddler $basetitle="test" >
</$action-createtiddler>

I found an example on the tiddlywiki website, but a bit more advanced to be used for assigning different tags to a particular tiddler depending on the choice you make in the drop down 

but what i need is much simpler  , and not sure if its the same thing ,so is it even possible?
 

Mark S.

unread,
Jan 19, 2022, 1:53:51 PM1/19/22
to TiddlyWiki
I'm guessing that you want something like:

```
\define myactions()
<$list filter="[{!!status}match[vendor]]">
<$action-createtiddler $basetitle="test" />
</$list>
\end

Status  <$select field="status" actions=<<myactions>> >
<option>Pending/Blocked</option>
<option value="vendor">With Vendor</option>
<option>In House</option>
</$select>

```
Note that the macro (i.e. \define ... \end) needs to be at the top of your tiddler.

The macro is triggered inside the select widget in the "actions" attribute.
I'm assuming that you only wanted ONE of the selections to trigger an action. So the list widget in the macro checks to see if you've selected "vendor" as the status.

HTH

PMario

unread,
Jan 20, 2022, 6:39:40 AM1/20/22
to TiddlyWiki
try this

```
\define test-action()
<$action-createtiddler $basetitle="test" text={{asdf}}/>
\end

Status  <$select tiddler=asdf actions=<<test-action>>>

<option>Pending/Blocked</option>
<option>With Vendor</option>
<option>In House</option>
</$select>
```

-m

mohamed maghrabi

unread,
Jan 24, 2022, 5:31:18 AM1/24/22
to TiddlyWiki
Thanks Mark /Mario

Works perfectly !

Reply all
Reply to author
Forward
0 new messages