I'm quite new to TiddlyWiki, but already fascinated by it. Right now
I'm trying to make a lab book from it using the journal functionality.
The question is how could I configure the DefaultTiddlers so that only
the latest in my journal entries will appear when TW is loaded? I can
display them all (with [tag[journal]sorted[-created]]) but I suspect
that with the lab book growing this will become too lengthy and slow
(and useless) to display at startup.
Thanks in advance,
Pavlo.
Make a backup of your valuable TW file :)
Make a new tiddler titled: DisplayDefaultTiddlersLimitedPlugin
Tag it: systemConfig
and copy the following lines into it.
/***
''Be aware!''
This function will @@overwrite@@ the displayDefaultTiddlers
function from TW core. This function is called at startup time,
once from the "restart" function. If you use any plugin, that calls
the restart or displayDefaultTiddlers function they will be
influenced.
***/
/*{{{*/
Story.prototype.displayDefaultTiddlers = function() {
var number = 2; //change this to any number of tiddlers you want to
display
var tids = store.filterTiddlers(store.getTiddlerText
("DefaultTiddlers"));
if (tids.length > number) tids.length = number;
this.displayTiddlers(null,tids);
}; // Story.proto ..
/*}}}*/
There are 6 lines of code between /*{{{*/ and /*}}}*/ goog.le will
wrap the lines. So take care.
There is a "var number = 2;" that should be changed to a number of
tiddlers you want to display at startup. I used 2 for testing.
Don't forget to tag it "systemConfig" and reload the TW.
regards Mario
On Jan 6, 12:05 pm, Pavlo Shchelokovskyy <shchelokovs...@gmail.com>
wrote:
and put a link to the tiddler in DefaultTiddlers...
A more sophisticated solution would be to use Yann Perrins NEWS plugin
(http://yann.perrin.googlepages.com/twkd.html#N.E.W.S) and change it
so it uses the tag "journal" instead of "blog"..
It's very nice because it opens the last modified tiddler tagged blog/
journal and creates two lists in the mainmenu - one for tiddlers not
yet visited from this browser and another for already visited
(archive)...
I think I will give it a go .. I will get back when I have a working
solution... untill then you can have a glimpse at my Danish TW which
uses it here: http://twgroup.tiddlyspot.com
regards Måns Mårtensson
On 6 Jan., 12:05, Pavlo Shchelokovskyy <shchelokovs...@gmail.com>
wrote:
Try this:
Create a tiddler [[SetDefaultTiddlers]], tagged with systemConfig,
containing this one line of code:
-----------------
config.shadowTiddlers["DefaultTiddlers"] = "[["+store.getTaggedTiddlers
("journal","modified").reverse()[0].title+"]]";
-----------------
Then, just *delete* the existing DefaultTiddlers. When you save-and-
reload, the above code will automatically re-write the *shadow*
definition of DefaultTiddlers so that it will then open the most
recently modified 'journal' tiddler.
enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
- I like Erics solution better though :-)
regards Måns Mårtensson
regards Måns Mårtensson
Pavlo.
Just disable the one-line [[SetDefaultTiddlers]] plugin tiddler, by
either removing the 'systemConfig' tag, or adding the
'systemConfigDisable' tag. After you save-and-reload, the standard
default shadow value will once again be used.
Alternatively, you can leave the plugin enabled and simply create an
actual [[DefaultTiddlers]] tiddler containing a space-separated,
bracketed list of tiddler titles to open upon startup. Then, it won't
matter if the [[SetDefaultTiddlers]] plugin is still enabled, as the
shadow tiddler value will never be used if a real [[DefaultTiddlers]]
exists.
tiddlertitle: OpenToday
var title = new Date( );
title = title.formatString("[[DD MMM YYYY]]");
store.saveTiddler( "DefaultTiddlers", "DefaultTiddlers", title );
tag with systemConfig
It opens a tiddler with todays date, even if it hasn't been made yet..
regards Måns Mårtensson
On 6 Jan., 21:14, Måns <humam...@gmail.com> wrote:
> Journal - NEWS> It's very nice because it opens the last modified tiddler tagged blog/
> > journal and creates two lists in the mainmenu - one for tiddlers not
> > yet visited from this browser and another for already visited
> > (archive)...
>
> should be: " .. it displays the last modified tiddlers tagged with
> "journal", which were modified since your last visit."
> if there is none - it will use the normal DefaultTiddlers!!>.. I will get back when I have a working solution...
>
> Here it ishttp://journaler.tiddlyspot.com