<$vars curr=<<currentTiddler>>>
<$list filter="[tag[genre]]">
<$list filter="[<curr>tag<currentTiddler>]"><$link/>, </$list>
</$list>
</$vars>
Well, the title says it all. Very simple one.E.g. if I have a small movie base and I have "genre" tags like "Action", "Drama", "Comedy", etc. and I marked all those tags with "genre" tag.And now I want to show them as clickable Tiddlers in the text field of a current Tiddler like:Genre: [[....]], [[...]], [[...]]
Genre:
<$list filter="[tag[genre]]" variable="genre">
<$list filter="[<currentTiddler>tag<genre>]">
<$link to=<<genre>>/>,
</$list>
</$list>
<$list filter="[<currentTiddler>enlist{!!tags}]" variable="thistag">
<$list filter="[<thistag>tag[genre]]">
<$link to=<<thistag>>/>,
</$list>
</$list>
You can use nested $list widgets, like this:
Genre:
<$list filter="[tag[genre]]" variable="genre">
<$list filter="[<currentTiddler>tag<genre>]">
<$link to=<<genre>>/>,
</$list>
</$list>The outer $list gets each tiddler tagged with genre.The inner $list checks if the current tiddler has that genre as a tag
| ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄| | Thanks a lot, Eric! |
|____________|(\__/) ||
(•ㅅ•) ||
/ づ
Errmm... Nope.... :)As a result I get current tiddler title shown 9 times... :)
OR...<$list filter="[<currentTiddler>enlist{!!tags}]" variable="thistag">
<$list filter="[<thistag>tag[genre]]">
<$link to=<<thistag>>/>,
</$list>
</$list>The outer $list gets all tags for the current tiddlerThe inner $list checks each of those tags to see if it is a genre
[enlist{!!tags}]+[tag[genre]]
I think the shortest and most performant filter is: [enlist{!!tags}]+[tag[genre]]
It lists the tags of the current tiddler and then looks, if it has a tag "genre"
There are 2 lists:
The first will give you a comma separated list.
<$list filter="[enlist{!!tags}]+[tag[genre]]"><$link/>, </$list>
The second will give you tag pills, that open a drop down list, if you click them.
<$list filter="[enlist{!!tags}]+[tag[genre]]"><<tag>></$list>
[enlist{!!tags}]+[tag[genre]]
Nit pick but even shorter:
[enlist{!!tags}tag[genre]]
As I understand $view won't do, so I have to use $list and probably use a filter [tags[]tag[genre]] or smth, but I'm lost in syntax once again...
Enlist is like list but treats the values as titles. So enlist{!!tags} treats the contents of the tags field as titles so it would respect spaces in titles and kind of wrap them in [[square brackets]] or ensure they are treated as titles.
Regards
Tony