I want to tweak the system macro timeline a little bit. Here is the code as you can see there are two list widgets in it. Outer list widget loop the date, and inner list loop the specific tids.
If you add keyword count on each. You can limit the count of date or the count of the tids in specific date.
What I want now is count them all and ignore date, let say I want 20 tids list out.
If Today have 15 and yesterday has 20, the final list will get all tids in today and top 5 in yesterday.
And I dont want to break the structure. how to make it?
Name of the tid need modified: $:/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$]!limit[10]]">
<div class="tc-menu-list-subitem">
<$transclude tiddler={{!!icon}}/> <$link to={{!!title}}><<timeline-title>></$link>
</div>
</$list>
</div>
</$list>
</div>
\end
The reason I need this is:
After make some tweak of the tw, the sidebar got something wrong, the tab and title will get out of the view of the page after scroll. I dont know how to change it back. I found that if limit the number of the recently tids, there is no need to scroll so the title and tab can stay there. Also make it since if the ““recent tab”” get too many tids, I wont see it. I just remember the last 10 tids I just used normally. So I ask the question like this, yes, it looks a little stupid if the sidebar no problem.
You can invoke the above using: <<mytimeline limit:20>>
Notes:
The macro starts by getting the list of tiddlers, sorted in descending order by dateField, limited to the desired number of tiddlers and saves this list in a variable named tids
Then, the subsequent filters use enlist<tids> to operate only on this list of tiddlers.