Hello everyone.
I’m trying to adapt a macro I found on a wiki to suit my needs but I can’t get it to work. It is a button that creates a tiddler with some predefined fields.
The button code is:
<$button actions={{$:/xp/ui/Actions/new-people}} tooltip="Create a new people" aria-label="new people" class="tc-btn-invisible tc-btn-mini">
<span class="tc-btn-icon">{{$:/core/images/new-button}}</span> new people
</$button> <small class="tc-sidebar-header">(<i><$count filter='[tag<aggregationTag>!has[draft.of]]'/> tiddlers</i>)</small> <$button to="$:/people-help" tooltip="PEOPLE Help" class="tc-btn-invisible tc-btn-mini">
<span class="tc-btn-icon">{{$:/core/images/help}}</span>
</$button>
</div>
The content of the tiddler $:/xp/ui/Actions/new-people that I replace with mine is as follows:
\define get-tags() $(textFieldTags)$
\define get-text() $(textField)$
<$vars textFieldTags={{$:/config/new-people/Tags}} textField={{$:/config/new-people/Text}}>
<$action-sendmessage $message="tm-new-tiddler" title=<<now "people-YYYY0MM0DD0hh0mm0ssXXX">> tags=<<get-tags>> text=<<get-text>> caption="a people" color="" description="" education="" lifetime="" image=""/>
</$vars>
This is the model ($:/model/person-2) that I try to make the button execute but I can’t get it to do so:
\define createNewItem()
<$action-sendmessage
$message="tm-new-tiddler"
title=<<unusedtitle """New $(new-item-title)$""">>
tags="[[$(currentTiddler)$]]"
foto="$:/plugins/kookma/thinkup/images/mr_avatar"
caption="name and title"
text=<<content>>
keywords=""
nombre=""
direccion=""
localidad=""
fecha_nac=""
telefono_f=""
/>
\end
\define content()
<$macrocall $name=image-pretty img={{!!foto}} align="right" caption={{!!caption}} tooltip={{!!caption}} alt=""/>
<table class="table-borderless source">
<tr><th>Nombre</th><td>{{!!nombre}}</td></tr>
<tr><th>Dirección</th><td>{{!!direccion}}</td></tr>
<tr><th>Localidad</th><td>{{!!localidad}}</td></tr>
</table>
: <<.lorem>>
;Observaciones
: <<.lorem>>
\end
I’ve been doing several tests but I can’t get it to work. Can you tell me what I’m doing wrong, or what I have to change?
Thanks in advance.