Now we want to have the possibility to display also the caption, and the author field form the tiddler that is displayed. Actually, only the content of the language specific tiddler will be displayed but the caption/title and author information from the tiddler.
So far as I was able to understand is there the possibility to use $action-setfield to write something into a field. But in this use case there is no action like a button or similar.
Is there a solution available I was not able to understand?
Thx in advance
Stefan (an old assembler developer who is struggling with the new concepts but willing to learn)
Not by default. All the action-widgets need a manual trigger. Mainly from buttons or link-clicks.
I did create a “trigger-widget” that will be triggered as soon as it is displayed. But you need to use it carefully, since it is able to trigger endless loops if used carelessly. See: Trigger — an interactive test framework
The TW UI templates do not handle any author field. So I assume, that you use a custom template to display an author field.
TW transclusions do have a “special” behaviour. If they do not find the $tiddler or $field value, they show the body of the transclusion.
So if you transclude the author field like this: <$transclude $field="author"><$transclude $tiddler=xxx $field="author"/></$transclude>
If the currentTiddler author field is empty, it will show the author field of tiddler “xxx”. So you only need to create the right filter for xxx in your template, depending on the selected language.
So no modification of tiddler fields should be needed.
I am trying to use the same procedure to exchange the caption also but thsi seems to be much more difficult.
If the language specific field contains a tiddler the title of this tiddler should be shown as title
If the the tiddler in (1.) has a field caption the content of this should be displayed
If there is no language specific field available and the tiddler has a field caption this content should be displayed
I not 1, 2 or 3 the title should be displayed.
I tried this her what is working well but not in Situation 4 or if the field caption contain a transcluding itself like Welcome to this {{NameOfThisTool}}
I don’t at all mind looking at it when I have time, but that’s likely not going to happen for a few days, as I have commitments the next three evenings and rarely have time lately during the workday.
But if you need to include {{NameOfThisTool}} you might need to add a call to wikify, probably by pulling the current <$link to value into a variable, and using it to generate a wikified result, which you could then paste as the <$link to value.