[TW5] List of links with tags

881 views
Skip to first unread message

Mark Heptinstall

unread,
Oct 23, 2016, 4:01:49 AM10/23/16
to TiddlyWiki
I am trying to create a list of links that contain a filtered list of tags next to them, this is what I have tried so far:

<$list filter="[tag[Reports]]">
* <$link to={{!!title}}><$view field="title"/></$link> <$list filter="[all[current]tags[]![Reports]sort[]]" template="$:/core/ui/TagTemplate"></$list>
</$list>

The issues with the above is that each item in the first $list is being render as separate <ul> instead of one with numerous <li>.
Tags are being displayed as desired though when you click on a tag the tag windows opens multiple times where tag appears in the list.

Obviously I am doing something wrong as I'm sure this is achievable and could also be created as a reusable macro?

Any help would be much appreciated.

Tobias Beer

unread,
Oct 23, 2016, 6:07:01 AM10/23/16
to tiddl...@googlegroups.com
Hi Mark,

Try using actual ULs and LIs:

<ul>
<$list filter="[tag[Reports]]">
<li>
<$link to={{!!title}}><$view field="title"/></$link>
<br>

<$list filter="[all[current]tags[]![Reports]sort[]]" template="$:/core/ui/TagTemplate"></$list>
</li>
</$list>
</ul>

Best wishes,

Tobias.

HansWobbe

unread,
Oct 23, 2016, 6:17:17 AM10/23/16
to TiddlyWiki
@Mark = A neat idea that simply had not occured to me.
@Tobias = An elegant solution.

Thank you both!



On Sunday, October 23, 2016 at 6:07:01 AM UTC-4, Tobias Beer wrote:
Hi Mark,

Try using actual ULs and LIs:

<ul>
<$list filter="[tag[Learning]]">
<li>
<$link to={{!!title}}><$view field="title"/></$link>
<br>
<$list filter="[all[current]tags[]![Reports]sort[]]" template="$:/core/ui/TagTemplate"></$list>
</li>
</$list>
</ul>

Best wishes,

Tobias.

Mark Heptinstall

unread,
Oct 23, 2016, 9:15:12 AM10/23/16
to TiddlyWiki
Thanks, though the tags still have the same behavior where clicking one causes the tag window to open on all tags of that type in the list. Any ideas?


On Sunday, October 23, 2016 at 11:07:01 AM UTC+1, Tobias Beer wrote:
Hi Mark,

Try using actual ULs and LIs:

<ul>
<$list filter="[tag[Learning]]">
<li>
<$link to={{!!title}}><$view field="title"/></$link>
<br>
<$list filter="[all[current]tags[]![Reports]sort[]]" template="$:/core/ui/TagTemplate"></$list>
</li>
</$list>
</ul>

Best wishes,

Tobias.

stevesuny

unread,
Oct 23, 2016, 1:12:07 PM10/23/16
to TiddlyWiki
Mark, you are running into issues involving "state", which I have trouble with as well. 

And, while I'm more-or-less confident the answer is in one of these tiddlers

//steve.

Tobias Beer

unread,
Oct 23, 2016, 3:54:19 PM10/23/16
to TiddlyWiki
Hi Mark,

Thanks, though the tags still have the same behavior where clicking one causes the tag window to open on all tags of that type in the list. Any ideas?

The problem here is that all instances of $:/core/ui/TagTemplate use the same state.

To me, this is how TiddlyWiki should and must learn to behave:

For a given popup-state tiddler...
  1. only one popup must ever be displayed
  2. and it must be displayed at the anchor button being clicked
Best wishes,

Tobias.

Tobias Beer

unread,
Oct 23, 2016, 4:21:09 PM10/23/16
to TiddlyWiki
Hi Mark,

I made a pull request with a change that will help with the issue:

allows to specify state qualifier for tag popups

However, imho, the solution it implements shouldn't be needed,
for the above mentioned reasons:
Reply all
Reply to author
Forward
0 new messages