Greetings, All
Sorry I abruptly ‘disappeared’ from the last conversation/question, but I’ve been in & out of the hospital several times, had a couple of operations and am still recovering from a fairly serious bike accident in July…
Anyway, I’m back with another (probably stupidly) simple question:
I’m trying to build a $List of links to Tiddlers with a specific tag Weekly
that also contain the Field linkcolor
, and color each link according to the value of linkcolor
.
linkcolor
will contain a value of either CSS color codes (#FF0000, etc) or simple color names (red, etc).
I tried querying AI and it gave me relevant code to create the $List (which I already had), but the coloring aspect that it suggested simply does not work, even after several attempts with different code.
Here is what it gave me originally:
<$list filter="[tag[Weekly]has[linkcolor]]">
<$link to=<<currentTiddler>>>
<span style="color:<<currentTiddler!!linkcolor>>;">
<<currentTiddler>>
</span>
</$link>
</$list>
After telling it that didn’t work, it revised:
Let’s try a slightly different approach to ensure the color is applied correctly. We’ll use the $set widget to explicitly set the linkcolor field value and then apply it within the $link widget.
Updated Code
<$list filter="[tag[Weekly]has[linkcolor]]">
<$set name="color" value=<<currentTiddler!!linkcolor>>>
<$link to=<<currentTiddler>>>
<span style="color:<<color>>;">
<<currentTiddler>>
</span>
</$link>
</$set>
</$list>
This solution also didn’t work, so it suggested:
Let’s refine the approach to ensure the color value is correctly interpreted. We’ll use the $set widget more explicitly to handle the color value. Here’s an updated version:
Updated Code
<$list filter="[tag[Weekly]has[linkcolor]]">
<$set name="color" value={{!!linkcolor}} >
<$link to=<<currentTiddler>>>
<span style="color:<<color>>;">
<<currentTiddler>>
</span>
</$link>
</$set>
</$list>
But, this also did not color the links, so I told it I was coming here for help, and would return later with the correct solution (we must show the proper respect to our future AI Overlords, ya know )
So, can anyone show me how to do this?
Thank You in advance