1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-07-02 02:03:14 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/filters/FilterOperator each.tid
2014-09-10 23:42:13 +01:00

28 lines
829 B
Plaintext

created: 20140410103123179
modified: 20140410103123179
tags: Filters
caption: each
title: FilterOperator: each
type: text/vnd.tiddlywiki
The ''each'' filter operator filters the current list to leave only the first tiddler with each distinct value for a specified field.
For example:
|!Filter String |!Description |
|`[all[tiddlers]sort[title]each[type]]` |Returns a list of the first tiddler with each distinct ''type'' field |
The ''each'' operator can be used to group tiddlers. For example, the following example creates a list of tiddlers split into types:
<$list filter="[!is[system]has[type]!type[text/vnd.tiddlywiki]each[type]sort[type]]">
<div>
! <$view field="type"/>
<$list filter="[type{!!type}!is[system]sort[title]]">
<div>
<$link to={{!!title}}><$view field="title"/></$link>
</div>
</$list>
</div>
</$list>