One option would be to call your macro like this:
<$macrocall $name="makeimg" isbn={{{ [{!!isbn}!is[blank]else{!!isbn13}] }}}
/>
This would be simpler:
\define makeimg()
<$vars isbn={{{[{!!isbn}!is[blank]else{!!isbn13}]}}}>
<$image source={{{
[[http://covers.librarything.com/devkey/dev-key-goes-here/medium/isbn/]addsuffix<isbn>]
}}}/>
</$vars>
\end
<<makeimg>>
For the generic book image fallback it depends on whether that is also a
remote image or a local one.
On Sunday, January 3, 2021 at 2:34:53 PM UTC+1 [email protected] wrote:
> My brain is obviously incapable of understanding TW documentation. Any
> way, here is the code
>
> \define makeimg(isbn) [img[
> http://covers.librarything.com/devkey/dev-key-goes-here/medium/isbn/$isbn$
> ]]
>
> <$macrocall $name="makeimg" isbn={{!!isbn}} />
>
> I need to basically add options for "if no isbn, use isbn13. If neither,
> then use this generic book cover image"
>
> isbn and isbn13 are both fields - when I imported, if the field was empty,
> the field was not set up in the tiddler, so it's not a blank field, it's a
> non-existent field. Half my books have one or the other, some have both,
> some have neither.
>
> Something like that...
>
> On Sunday, January 3, 2021 at 7:09:24 AM UTC-6 [email protected] wrote:
>
>> Sounds like something I would do either with filters use the else[]
>> operator, or with nested <$view> widgets (where the content of a view
>> widget is only displayed if the target field is absent).
>>
>> https://tiddlywiki.com/#ViewWidget
>>
>> Hard to be more specific without seeing your code.
>>
>> On Sunday, January 3, 2021 at 1:32:35 PM UTC+1 [email protected] wrote:
>>
>>>
>>> I have a working macro, but just realized that the field it uses is
>>> sometimes not present. There is an alternate field I would like to use in
>>> its place. I also need to use a 'dummy' result if *both* fields are not
>>> present.
>>>
>>> My dozens of searches through TW documentation and this group have so
>>> far proven futile. Could use some help...
>>>
>>>
--
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/c52ead92-539d-417c-a164-c433d7cbf2een%40googlegroups.com.