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 tiddlywiki+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/236dc841-86be-4c1d-9d06-b60c716602c2o%40googlegroups.com.