List widget not doing what I expect

I am trying to implement an edit template but only for those tiddlers with the tag Image Link

I am using this code:

<$list filter="[all[current]tag[Image Link]]" />
<$let 
     baseURL={{{ [{$:/TLS/onlineImages!!onlineimageURL}] }}}
     onlineURL={{!!imageURL}}  
>
<$image source={{{ [<onlineURL>] }}}  loading="lazy" >
     <$image source={{{ [<baseURL>addsuffix<onlineURL>] }}} loading="lazy" />
</$let>
</$list>

What I am noticing is shown in this screen dump:

the strings at the bottom of the window, an unfound image and closing let and list statements that disappear if I remove the edit template tag. So the edit template is being applied when it should not be.

I expected the starting list statement to only pass those tiddlers with the tag Image Link but this is obviously not so.

What am I doing wrong?

bobj

You have two $image widgets, only one is closed.

Is it appropriate to nest them?

Also expect editing an edit template to potentialy confuse things.

Your $list widget has /> at the end. This should be just >, so that the content that follows is inside the $list widget body.

Also, you are missing a matching </$image> for the outer $image widget.

-e

1 Like

@TW_Tones:
Normally, the $image widget ignores any enclosed content. However, @Bob_Jansen is using a modified version of $:/core/modules/widgets/image.js using code I provided here: Fallback handling for $image widget.

This altered core $image widget code allows you to provide fallback wikitext content (such as rendering an alternative $image widget) if the source=... specified in the enclosing $image fails to load.

-e

And I hope this gets into the core for next release, it has been so useful especially for Android users loading external images.

Thanks @EricShulman , removing that pesky slash made all the difference. I spent a long time looking at that code and didn’t see it. Shows just what a second pair of eyes can do.

Bobj

1 Like