I am not really sure how to describe my question, here is what I try:
I have a different tiddlers, some with field caption
containing text, some with field caption
containing transcluded value from another tiddler (eg: {{$:/language/caption}}
), some without field caption
.
I’d like to list them using $list
widget and link to them showing caption
value if exists or title
if not.
I tried this :
<$list filter="[tag[ConditionnalFilter]]">
<$link to=<<currentTiddler>>>
<$text text={{{ [all[current]get[caption]else{!!title}] }}}/>
</$link><br>
</$list>
but when the caption
field contains a transcluded value, the link being rendered is literal field value {{$:/language/caption}}
and not the content of this transclusion.
I’ve found a workaround using two filters :
<$list filter="[tag[ConditionnalFilter]]">
<$link to=<<currentTiddler>>>
<$list filter="[all[current]has[caption]]">{{!!caption}}</$list>
<$list filter="[all[current]!has[caption]]"/>
</$link><br>
</$list>
I’d like to be sure that there isn’t a prettiest way to do this, or something I’ve missed.