Stephan,
I am a little confused about you question as well.
I do not really like the notation of the placeholders
This is not helpful, the notation should not be the problem, perhaps its
you use of it, I think your issue is with the concept of templates
Have you tried {{||templatename}} in a tiddler?
or {{||mailtemplate}} in a new email message
This will display the current template in your currenttiddler using the
values in the current tiddler not the template. ie {{!!fieldname)) is a
fieldname in the current tiddler not the template.
The edit text widget https://tiddlywiki.com/prerelease/#EditTextWidget has
a placeholder parameter
To use a variable in this widget its a simple matter of
placeholder=<<placeholder>>
By the way
You original post has the following which is incorrect.
The due date is {{!!due_date]].
Regards
Tony
On Wednesday, 30 October 2019 20:04:03 UTC+11, Stephan Hradek wrote:
>
> Background of my question: For a colleague who often needs to write
> standard mails I've created a TiddlyWiki where one can create 2 tiddlers.
> One with the standard mailtext using place holders. The placeholders are
> also defined in the template. Example below. The other tiddler is simply
> one piping the mailtemplate-tiddler through a tiddler which will generate
> the form to fill in the placeholders.
>
> Example for the mailtemplate:
>
> [[subject:Request for offer {{!!company}}]]
> [[recipients:[email protected]]]
> [[company:Company Name]]
> [[due_date:Due date]]
> [[revenue:Annual revenue]]
> [[known_cb,not,already:Company known]]
>
> Dear Mr. Offerman
>
> The company {{!!company}} asked for an offer.
>
> Their annual revenue is {{!!revenue}}.
>
> The due date is {{!!due_date]].
>
> {{!!company}} is {{known_cb}} known to us.
>
> Best regards…
>
> The tiddler showing the form is then just something like this:
>
> {{
> Mailtemplate:Request for offer -- Generate Mail
> ||
> Create Mail
> }}
>
> and the resulting form will look something like this:
>
> +----------------+---------------------------------+
> | Recipients | [email protected] |
> +----------------+---------------------------------+
> | Subject | Request for offer {{!!company}} |
> +----------------+---------------------------------+
> | Company | [_____________] |
> +----------------+---------------------------------+
> | Due date | [_____________] [cal] |
> +----------------+---------------------------------+
> | Annual revenue | [_____________] |
> +----------------+---------------------------------+
> |Company known | [_] already |
> +----------------+---------------------------------+
>
>
> This already works quite well, but I do not really like the notation of
> the placeholders {{!!placeholder}}. This is due to the fact that the
> generated form simply stores the values in fields in the mailtemplate.
>
> Since I had difficulties with the recipients and the subject, they are not
> editable and are not in fields. I first wanted to make them editable but
> this did not work as the defaults won't appear unless the tiddler, where
> the fields are located, does not exist. Moreover the defaults are not
> stored unless you explicitly go into the fields. As a result these 2 values
> are stored in variables.
>
> So my next idea was: Wouldn't it be nice, placeholders could be written in
> the form <<placeholder>>?
>
> Unfortunately I am not able to generate a set of variables dynamically.
> You see: I do not know beforehand which placeholders will be used in a
> mailtemplate. So I go through the mailtemplate with the ListWidget, finding
> the placeholders from the top part, generating the input elements. Creating
> variables by this is of course not possible.
>
> But maybe someone here has an idea how to do this?
>
>
>
>
>
--
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/7cbeead3-367b-4a9b-a908-bcd82d0ab2fd%40googlegroups.com.