This page is part of a static HTML representation of the TiddlyWiki at https://tiddlywiki.com/

GroupedLists

21st February 2015 at 11:01pm
Lists ListWidget

The following sidebar tabs give examples of grouped lists created by nesting.

Types Tab

For the Types tab, the outer list filter as shown below selects each discrete value found in the type field. The inner list filter selects all the (non-system) tiddlers with that type.

<$list filter={{$:/core/Filters/TypedTiddlers!!filter}}>
<div class="tc-menu-list-item">
<$view field="type"/>
<$list filter="[type{!!type}!is[system]sort[title]]">
<div class="tc-menu-list-subitem">
<$link to={{!!title}}><$view field="title"/></$link>
</div>
</$list>
</div>
</$list>

Recent Tab

The list in the Recent tab is generated using the timeline macro. Here, the outer list filter selects each discrete day found in the modified field, while the inner list filter selects all the tiddlers dated the same day in the modified field.

$:/core/macros/timeline:

\define timeline-title()
\whitespace trim
<!-- Override this macro with a global macro 
     of the same name if you need to change 
     how titles are displayed on the timeline 
     -->
<$view field="title"/>
\end
\define timeline(limit:"100",format:"DDth MMM YYYY",subfilter:"",dateField:"modified")
<div class="tc-timeline">
<$list filter="[!is[system]$subfilter$has[$dateField$]!sort[$dateField$]limit[$limit$]eachday[$dateField$]]">
<div class="tc-menu-list-item">
<$view field="$dateField$" format="date" template="$format$"/>
<$list filter="[sameday:$dateField${!!$dateField$}!is[system]$subfilter$!sort[$dateField$]]">
<div class="tc-menu-list-subitem">
<$link to={{!!title}}><<timeline-title>></$link>
</div>
</$list>
</div>
</$list>
</div>
\end