Great, thaks! I didn't come up with an idea to use the $list widget

best
Darek
czwartek, 17 września 2020 o 16:08:38 UTC+2 Eric Shulman napisał(a):

> On Thursday, September 17, 2020 at 6:28:00 AM UTC-7, Darek Bobak wrote:
>>
>> There is a field. Let's say, bibtex-doiuri.
>> If the field has any value, i'd like to get as an output:
>> [[DOI|content_of_the_field]]
>> If the field is empty, i'd like to get nothing. An empty string.
>> The result should appear within the $list widget (if it matters).
>>
>
> First, define a macro that assembles the desired output, like this:
> \define MakeDOILink() [[DOI|$(uri)$]]
>
> Next, define a macro that gets a field value and passes it to the 
> MakeDOILink, like this:
> \define DOILink() <$list filter="[<currentTiddler>get[bibtex-doiuri]]" 
> variable="uri"><<MakeDOILink>></$list>
> If the field "bibtex-doiuri" is empty (or doesn't exist) then the get[...] 
> filter doesn't produce any result, and thus <<MakeDOILink>> is not invoked.
>
> Then, to use it, just write:
> <<DOILink>>
>
> enjoy,
> -e
>

-- 
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/78fb8777-09cd-4570-b2bd-895f4d702a97n%40googlegroups.com.

Reply via email to