An Update:

Thanks to everything that has responded. Alas, thus far, I have been unable 
to find or develop an exact match function.

Here is the macro I promised that generates a table which lists tiddlers in 
order of their respective tags field.
Each unique set of tags is listed on a separate line of the table, followed 
by the list of tiddlers that possess those tags.

Writing the plugin was made much easier thanks to Tobias Beer's 
''contains'' plugin, which can be found at 
http://tobibeer.github.io/tw5-plugins/#contains.
I am having difficulties in setting up an example on tiddyspot. As an 
alternative a listing of the macro is given below.

Steve Wharton

```
\define listAsTableSortedByTagField(filter:"[!is[system]]" titleText 
captionText)

<!-- By Stephen Wharton (last revised Dec 3, 2016)

      Generate a table of tiddlers listed in order of their unique sets of 
tags. 
      * first column is the unique set of tags formatted as pills
      * second column is the list of tiddlers that match the tags from the 
first column
-->

<!-- Optionally sort the tags in place for each tiddler
-->
<$button>Sort Tags In Place (Ascending Order)
<$list filter="[!is[system]!has[draft.of]] +$filter$">
<$set name=TagsString filter='[<currentTiddler>tags[]sort[]]'>
<$action-setfield tags=<<TagsString>>/>
</$set>
</$list>
</$button>


<!-- Sort the tiddlers according to their (sorted) tags.
       Generate the table by listing the tiddler title, followed by tag 
pills.
-->
<table>
<tr>
<th>Unique Sets of Tags</th>
<th>Matching Tiddlers per Tag Set</th>
</tr>
<$list filter="$filter$ +[each[tags]] +[sort[tags]]">
<$set name=currentTags filter='[<currentTiddler>tags[]sort[]]'>
<tr><td class="cellWidth4Pills"><$list filter="[all[current]tags[]]" 
template="$:/core/ui/TagTemplate" storyview="pop"/></td>
<td class="cellWidth4Titles"><<listViaContains>></td>
</tr>
</$set>
</$list>
</table>

\end

<!-- Example Application
-->
<<listAsTableSortedByTagField filter:"[tag[music]]" 
titleText:"listSortedByTagField - example application">>
```







-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/381c3f58-0468-401f-9f93-7091e4806a46%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to