Multiple DefaultTiddlers?

38 views
Skip to first unread message

kuyanatan

unread,
Aug 26, 2010, 11:47:31 AM8/26/10
to TiddlyWiki
Hi everyone,

I'm trying to change DefaultTiddlers so that it displays the latest
journal and a new one for today. However, I can't make it display
both. If it's possible, can someone please help me?

The code to display the latest journal:
config.shadowTiddlers["DefaultTiddlers"] =
"[["+store.getTaggedTiddlers("journal","modified").reverse()[0].title
+"]]";

The code to display a new journal for today:
config.shadowTiddlers.DefaultTiddlers=new Date().formatString("\[\
["+"DDD, MMM DD YYYY"+"\]\]");

Thank you, I appreciate your help!

FrD

unread,
Aug 27, 2010, 5:16:25 AM8/27/10
to TiddlyWiki
If you have InlineJavaScriptPlugin installed (http://
www.tiddlytools.com/#InlineJavascriptPlugin), you could try this in
your mainMenu :

<script>
var tid=store.getTaggedTiddlers("journal","modified")[0];
story.displayTiddler(null,tid);
</script>

<script>
var title=new Date().formatString("DD MMM YYYY");
var tid=store.getTiddler(title);
if(!tid)
store.saveTiddler(title,title,"test",config.options.txtUserName,new
Date(),["journal"],{});
story.displayTiddler(null,title);
</script>

FrD

Eric Shulman

unread,
Aug 27, 2010, 8:34:37 AM8/27/10
to TiddlyWiki
[[DefaultTiddlers]] can contain a *list* of tiddler titles (and/or tag
filters), stored as a white-space separated list of titles.

To open several tiddlers, simply write:
[[SomeTiddler]] [[SomeOtherTiddler]] [[YetAnother]] etc.

For your purposes, you can just combine the code for the two pieces of
text you already generate, like this:

config.shadowTiddlers["DefaultTiddlers"] = "[["
+ store.getTaggedTiddlers("journal","modified").reverse()[0].title
+ "]] [["
+ new Date().formatString("DDD, MMM DD YYYY")
+ "]]";

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios



kuyanatan

unread,
Sep 28, 2010, 10:18:54 PM9/28/10
to TiddlyWiki
Thanks, everyone! I appreciate it!

(Apologize for the late reply, I almost forgot about this post.)
Reply all
Reply to author
Forward
0 new messages