Hopefully this is helpful. I also find the syntax arcane and still struggle with constructing code like the following.
\define makeimg() <$vars imgurl="http://covers.librarything.com/devkey/dev-key/medium/isbn/" fallback="[[Normal Link|http://google.com]]" isbn={{{[{!!isbn}!is[blank]else{!!isbn13}]}}} > <$list filter=<<isbn>> emptyMessage=<<fallback>>> <$image source={{{[<imgurl>addsuffix<isbn>]}}}/> </$list> </$vars> \end <<makeimg>> On Sunday, January 3, 2021 at 2:39:18 PM UTC-5 dix...@gmail.com wrote: > Thank you very much for your help! > > I guess I need to give up on this particular idea. There are only so many > hours I can spend struggling with something like this before I am simply > ready to ditch TiddlyWiki altogether. I really struggle with the syntax. > Depending on the context, I may need one, two or three curly braces, or > maybe '<' - or maybe '<<' - and I can't find any rhyme or reason for these > contexts. The documents seem to be written for someone familiar with > multiple programming languages. That's not me. > > I just need a simple if/then/else and that seems to require a lot of > strange workarounds. I guess I'll look for that elsewhere... > > On Sunday, January 3, 2021 at 11:20:57 AM UTC-6 saq.i...@gmail.com wrote: > >> Wrap the image part in a <$list> widget that tests whether isbn is blank. >> You can use the emptyMessage attribute to show the plain URL instead when >> there is no isbn. >> >> On Sunday, January 3, 2021 at 4:10:44 PM UTC+1 dix...@gmail.com wrote: >> >>> Yes, but I need a plain URL, not an image link, so wouldn't be able to >>> use <$image ... >>> >>> On Sunday, January 3, 2021 at 9:08:08 AM UTC-6 saq.i...@gmail.com wrote: >>> >>>> The last example does that, it falls back to an entirely different URL >>>> if no ISBN fields exist. >>>> >>>> On Sunday, January 3, 2021 at 3:59:03 PM UTC+1 dix...@gmail.com wrote: >>>> >>>>> This looks nice! It appears to put all the right code in the right >>>>> place. Now if only librarything servers would quit dying on me... >>>>> >>>>> Are there any other widgets with :filter and :else options that I >>>>> could use to do something similar w/ a link? Specifically, use isbn or >>>>> isbn13 in link, but if they don't exist show this *other* link? I've been >>>>> using [ext[ link format, but need to do some if/then... >>>>> >>>>> On Sunday, January 3, 2021 at 8:38:38 AM UTC-6 saq.i...@gmail.com >>>>> wrote: >>>>> >>>>>> Here is an example on falling back to the generic image if no ISBN >>>>>> fields are defined >>>>>> >>>>>> \define makeimg() >>>>>> <$vars isbn={{{[{!!isbn}!is[blank]else{!!isbn13}]}}}> >>>>>> <$image source={{{ [[ >>>>>> http://covers.librarything.com/devkey/dev-key-goes-here/medium/isbn/]addsuffix<isbn>] >>>>>> >>>>>> :filter[<isbn>!is[blank]] :else[[generic image URL]] }}}/> >>>>>> </$vars> >>>>>> \end >>>>>> >>>>>> <<makeimg>> >>>>>> >>>>> -- 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/d8c5b55c-4c92-4737-b630-15c89db21d37n%40googlegroups.com.