Hello everyone.
I’m struggling with some code and can’t get it to work. I don’t know how many interactions I’ve made, and GPT Chat can’t seem to help me.
I have three fields defined: “resolved_by”, “url”, “medium”.
What I want is for the following to be displayed in the tiddler header using a tiddler labeled with $:/tags/ViewTemplate:
After the text “Resolved by:”, I want the values in the “resolved_by” field to be displayed. It can be one or more, and they can also contain compound words with spaces in between. If the field is empty, I want it to say “Not Found”.
Then, if the “medium” field has a value, I want it to display:
If I don’t have a “url”, I want the value of “medium” to be displayed after the text “in”.
If I have “url”, I want it to combine the “url” and “medium” fields as follows: [[medium|url]]
If the “medium” field is empty, then nothing should be added after the “resolved_by” value (this is something I wanted but isn’t in the code yet).
This is the code I’m using, but I can’t get it to work.
<$set name="resueltopor" tiddler=<<currentTiddler>> field="resuelto_por" />
<$set name="url" tiddler=<<currentTiddler>> field="url" />
<$set name="medio" tiddler=<<currentTiddler>> field="medio" />
<!-- Mostrar Resuelto por -->
''Resuelto por'':
<$list filter="[<resueltopor>is[blank]]">
Desconocido
</$list>
<$list filter="[<resueltopor>!is[blank]]">
<$list filter="[enlist<resueltopor>trim[]]" variable="item">
<$text text=<<item>> />
<$list filter="[<item>!match[<resueltopor>last[]]]">, </$list>
</$list>
</$list>
<!-- Mostrar medio si no hay URL -->
<$list filter="[<url>is[blank]]">
<<medio>> </$list>
<!-- Mostrar medio si hay URL -->
<$list filter="[<url>!is[blank]]">
en [[<<medio>>|<<url>>]]
</$list>
Thanks in advance.