I’ll like to add automatically an image to certain tiddlers matching the conditions eg. “Jahr 2024” and will address the issue hovering the image - see Zoom image in titlebar as a “popup”
I’ll like to add automatically an image to certain tiddlers matching the conditions eg. “Jahr 2024” and will address the issue hovering the image - see Zoom image in titlebar as a “popup”
I don’t know if this is exactly what you’re looking for @StS, but this is the code I use to conditionally render icons in my titles, derived from Soren’s Zettellkasten
Note that unlike the CSS, where we used “Jahr (2024)” directly ( [data-tiddler-title*="Jahr (2024)"] ), here we need to escape characters with special meaning in regexes, here the parentheses ( regexp[Jahr \(2024\)] ). Other than that, it’s pretty simple… once you learn that the icon cascade exists. Note that I used list-after: $:/config/TiddlerIconFilters/icon-field. That means that if the tiddler has an icon field, it will be used instead of this. If you want this to appear even if there is an icon field, then switch to list-before instead.
You can test this by downloading this and dragging it to any wiki:
Thank you for the question. I didn’t realize there was a cascade available for the icon name.
That’s what I thought at first reading too, but now I think that’s not really the question. Please correct me if I’m wrong, @StS, but I believe the idea is to have the icon show up before the title—as it would with an icon field— not specifically to add such a field.
I wasn’t trying to help you with your hover issue, just demonstrate how you can address the various parts of the tiddler with CSS. I haven’t looked at the hover issue, although I saw it when you posted it. I thought this thread was about how to conditionally use CSS based on the tiddler title. That’s all I was addressing here.
If you use this CSS it should do the trick. But do not use position: absolute.
The “jumpy” change IMO does not look good. So you should use an animation.
But I do not really see the value of that size change. What do you try to achieve?
I use it to assign an image of the author of the tiddler article.
With the hover effect I enlarge the small image. Thats it.
If it is not working as expected, than it is, as it is - no big issue.
Thanks to @Scott_Sauyet who gave me the solution to add the proper icon depending of the content of the title.