Good afternoon,
I have a form to input students’ personal info using $edit-text, a temporary tiddler to hold the values (name, age…) and a template for the students tiddlers. I would like to include a path for an image, for example, “johndoe”, which would be rendered by the template, after reading the field “image” of the student’s tiddler.
If I write “{{||$:/images/johndoe}}” in the image field and “{{!!image}}” in the template I get the picture transcluded. But otherwise I would like to introduce first and last name in the form, “johndoe”, when registering a student and then use the field value of the image field, “johndoe” , to show the image…
Thank you
Are the images stored in the TW file, or on the hard drive, or in the cloud?
Are the image tiddlers all named like:
$:/images/johndoe, $:/images/janedoe, etc. ?
Thanks, The images are in the TW file. I fill the form and a tiddler is cretated with a name for the title, imagine John Doe and some fields with values (age, date of bith, guardian’sname, contact…) based on a template. In the form I would like to give the name of the image, for example “johndoe”, get a field in the student’s tiddler with that for value, and use that field to automatically show the image (already in $:/images/johndoe). Or upload the image from the form?
Using
<$image source=`$:/image/$(currentTiddler)$`/>
in a field can give you the image if you follow the naming pattern $:/image/John Doe
even with blanks.
I have a procedure to show the “main-image” relating to a tiddler in a fancy frame.
\procedure titleimgframe(width:"300px")
<$image source=`$:/img/$(currentTiddler)$` class=frame image-align-right width=<<width>> />
\end
Another way is:
<$image source={{{ [all[current]addprefix[$:/img/]!is[missing]] }}} />
That shows the image only if it exists. If you don’t have an image of a person, there is no irritating error icon but just nice space.
Thank you, @Hanlon , but the image doesn’t show. Anyway it would be too much text (code) to insert in a form (not functional)…