Am Sonntag, 18. Mai 2014 10:57:10 UTC+2 schrieb Frederico Jeronimo:
>
> 1. Retrieve the category tag by colour or less ideally by a static
> white list (there shouldn't be more than one, but if so, pick the first
> one).
>
> I have no clue what you mean by "category tag". Maybe you can explain?
>
> 1. Fetch the associated icon of the chosen category tag (these are
> vector graphics from font-awesome).
>
> I would associate that with a class where the CSS then links to the
graphics.
>
> 1. Apply it to the left of the link automatically when rendering
> without the need for the user to specify anything.
>
> I would do this with CSS. Using ":before" selector and "content: url(…)"
> Scan the target tiddler tags.I understand that this might be trickier to
> implement, so I'm definitely not too fuss about it (i.e. more than happy to
> set the icons by hand).
>
>
Actully that is not too complicated. Use a template tiddler. Maybe this
gets you going:
1. Put a field "class" into each of your target tiddlers. As I did not
understand your definition above, I thought I made it simple first ;)
2. Create a template tiddler "mylink" which does the "magick":
<$set name="myclass" value={{!!class}}>
<span class=<<myclass>>><$link><$view field="title"/></$link></span>
</$set>
You see? I simply put a <span> around the actual link, so you get
<span="value of the tiddler's class field"><a href="…">tiddler's title
</a></span>
Your CSS needs to be something like:
span.MyClass > a:before {
content: url(…);
}
3. Use the template tiddler instead of your normal [[myTargetTiddler]] like
so:
{{myTargetTiddler||mylink}}
--
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.