\define my-actions()
<$action-sendmessage $message="tm-add-field" $param="address"/>
<$action-sendmessage $message="tm-add-field" $param="phone"/>
<$action-sendmessage $message="tm-add-field" $param="email"/>
<$action-sendmessage $message="tm-add-field" $param="reference"/>
\end
<$list filter="[is[current]tag[contact]]">
<$button actions=<<my-actions>>>
Click to add contact fields
</$button>
</$list>
I think my way would be to make a macro and use it instead of links. Something like
<<contact jane>>
If "jane" exists, it displays a link. If "jane" doesn't exist, it displays a button labeled "jane". Click on the button to create the new "jane" tiddler. I haven't thought through the details, but I'm pretty sure all this is possible. I'm sure a macro that displays both a link and a button is possible, if nothing else.
Some others may have creative suggestions as well.
Good luck,
-- Mark
For now i am trying to create a macro as suggested by Matt but how does one check for a tiddler's existence?
\define contact(name)
<$list filter="[title[$name$]is[missing]]">
<$button>
<$action-createtiddler
$basetitle='$name$'
tags='contact'
address=''
phone=''
email=''
reference=''
birthday=''
$savetitle={{ContactMacro!!newContact}}
/>
<$action-sendmessage $message="tm-edit-tiddler" $param={{ContactMacro!!newContact}}/>
create $name$
</$button>
</$list>
<$list filter="[title[$name$]is[tiddler]]">
[[$name$]]</$list>
\end