This would be outside the scope of Relink, but there are ways to
programmatically fill out a generated tiddler.
\define body()
Dear $(name)$,
I write to inform you that your pet, $(pet)$ has filed for emancipation.
\end
\define createButton()
<$button tooltip="Create new letter" aria-label="new version" class=<<tv-
config-toolbar-class>>>
<$action-sendmessage $message="tm-new-tiddler" title=<<title>> text=<<body>>
/>
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
{{$:/core/images/new-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
<span class="tc-btn-text"><$text text="new letter" /></span>
</$list>
</$button>
\end
<$set name="title" value="New Letter">
<$set name="name" value="Wilson">
<$set name="pet" value="snuffles">
<<createButton>>
</$set></$set></$set>
This will create a new tiddler. with a variable title, name, and pet.
-Flibbles
On Monday, March 23, 2020 at 9:20:52 PM UTC-4, TonyM wrote:
>
> Folks,
>
> I have a little project where it would be helpful if I could create a
> tiddler from a template (for its body) but then replace various content
> within the text or fields with different values.
>
> For example what if the template included ##name## then I had a macro that
> would replace in the body of the new tiddler
>
> - ##name## with Tony
> - ##icon## with {{<<tiddlername>>||$:/core/images/info-button}}
> - etc...
>
> I imagine if a set of such changes could be triggered by a button and an
> action widget all the better.
>
> I have other ways to achieve this but it would surprise me if the code was
> not already available somewhere.
>
> Any leads would be appreciated
>
> Regards
> Tony
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/8171d33a-54a0-483a-8f44-ebff137b0364%40googlegroups.com.