> But in fact I'd like to keep the timeline as it's handy for tinkering
> with systems stuff. Instead I'd like my default right-hand panel tab
> to be an extra timeline which only lists tiddlers that have a tag from
> a set I provide.
>
> I don't know: would that be easier/harder than 'patching' the default
> timeline by plugin?
To get exactly what you want, you can create your own, modified
timeline macro:
1) *view the TW source*
(in Firefox: View->Page Source).
2) find the core's code for processing the standard <<timeline>> macro
(search for "config.macros.timeline.handler")
3) Copy/paste that function into a tiddler, e.g., [[MyTimelinePlugin]]
------------------------------
//{{{
config.macros.timeline.handler = function(place,macroName,params)
{
var field = params[0] || "modified";
var tiddlers =
store.reverseLookup("tags","excludeLists",false,field);
var lastDay = "";
var last = params[1] ? tiddlers.length-
Math.min(tiddlers.length,parseInt(params[1])) : 0;
var dateFormat = params[2] || this.dateFormat;
for(var t=tiddlers.length-1; t>=last; t--) {
var tiddler = tiddlers[t];
var theDay =
tiddler[field].convertToLocalYYYYMMDDHHMM().substr(0,8);
if(theDay != lastDay) {
var ul = document.createElement("ul");
place.appendChild(ul);
createTiddlyElement(ul,"li",null,"listTitle",tiddler[field].formatString(dateFormat));
lastDay = theDay;
}
createTiddlyElement(ul,"li",null,"listLink").appendChild(createTiddlyLink(place,tiddler.title,true));
}
};
//}}}
------------------------------
4) Add these two lines just before the function declaration
config.macros.myTimeline={};
config.macros.myTimeline.dateFormat=config.macros.timeline.dateFormat;
5) change the NAME of the function from "timeline" to "myTimeline"
config.macros.myTimeline.handler = function(place,macroName,params)
6) Add this line at the beginning of the function:
var myTag=params.shift();
7) Immediately following these lines of code:
for(var t=tiddlers.length-1; t>=last; t--) {
var tiddler = tiddlers[t];
add this line:
if (tiddler.isTagged(myTag)) continue;
8) Tag [[MyTimelinePlugin]] with "systemConfig"
9) Create a tiddler named [[TabMyTimeline]], containing:
<<myTimeline desiredTag>>
10) in [[SideBarTabs]], modify the <<tabs ...>> macro to include the
TabMyTimeline content on another tab by adding *three* more params
where you want them: Label Tooltip TiddlerName, e.g.:
Content "show timeline for content tiddlers" TabMyTimeline
That's it... Just save-and-reload and your new macro and tab will
appear.
enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/tiddlywiki?hl=en.