Cmari

Yes there is and I somehow managed to not include it. Here it is ...

Steve Wharton

```
\define listViaContains()

<!--
       List all tiddlers that match the tags in the variable "currentTags".

       The "contain" plugin from Tobias Beer makes this very easy to do.
       (His plugin can be found at 
http://tobibeer.github.io/tw5-plugins/#contains)
-->

<$list filter="[contains:tags $all<currentTags>]">
<$link><$view field="title"/></$link>, </$list>

\end

<!-- Show an example to find all tiddlers that have the same tags as the
       "macroDef: listViaContains" tiddler.
-->
<$set name=currentTags filter='[<currentTiddler>tags[]sort[]]'>
<<listViaContains>>
</$set>
```




On Thursday, December 8, 2016 at 4:18:50 PM UTC-5, cmari wrote:
>
> Hi Steve,
> Is there another tiddler that contains the macro <<listViaContains>>? 
> Sorry if I overlooked something in your post.
> The table is really useful - thanks!
> cmari
>
> On Monday, December 5, 2016 at 5:45:28 AM UTC-8, steve wrote:
>>
>> 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 [email protected].
To post to this group, send email to [email protected].
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/489d5045-dcd0-4ec0-8354-f34ea24e0663%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to