So, I now have

<$image source={{A!!structure_file}} alt={{A!!title}} />

which I expected to would give the title of Tiddler A when the mouse 
hovered over the image (much as would occur with [img[description of 
file|folder/file.png]]). However, I note that the alt text only appears if 
the file is not found.

Is this the expected behaviour and is it possible, using $image, to produce 
the 'hover-over' text.

As ever, many thanks for any input.

Anthony

On Tuesday, 24 November 2020 at 22:28:18 UTC [email protected] wrote:

> Haha, good point, I'm overcomplicating things too. :-)
>
> On Tuesday, November 24, 2020 at 3:29:32 PM UTC-6 Eric Shulman wrote:
>
>> On Tuesday, November 24, 2020 at 11:37:52 AM UTC-8 [email protected] 
>> wrote:
>>
>>> Have you tried the image widget <https://tiddlywiki.com#ImageWidget>? 
>>> You might be making this a lot more complicated than necessary...from the 
>>> letter of what you wrote all you need to do is write this in tiddler B:
>>>
>>> <$image source={{A!!structure_file}}>
>>>
>>> In other words, you're transcluding the value of the structure_file 
>>> field of A as the value of the source image widget.
>>>
>>> Now if you need the tiddler A to be dynamic, rather than hard-coding it 
>>> in the wiki text, you'll have to get a bit more complicated. You might be 
>>> tempted to try this:
>>>
>>> \define makeTransclusion() {{$(myTiddler)$!!structure_file}}
>>> <$set name="myTiddler" value="A">  <!-- or however A gets determined -->
>>>     <$image source=<<makeTransclusion>>>
>>> </$set>
>>>
>>> But if you try that, you'll see the image link is broken. If you use 
>>> your browser's developer tools to inspect the image, you'll see it links 
>>> literally to "{{A!!structure_file}}".
>>>
>>
>> The reason the image is broken is because after the constructed widget 
>> parameter is "returned" by the macro, it is not parsed a *second* time 
>> to evaluate the transclusion.
>> However, if you place the entire $image widget inside the macro, you can 
>> forego the use of $wikify, like this:
>>
>> \define showStructure(tid) <$image source={{$tid$!!structure_file}} />
>> <<showStructure "A">>
>>
>> -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/984ca07e-25e4-42e1-bcaa-8824c72bf9a5n%40googlegroups.com.

Reply via email to