> But how one can transclude a number of tiddlers in one tiddler - while
> only displaying one particular - simultaneously removing the others by
> clicking a link??
You probably won't get around writing some custom JavaScript code for
this, programmatically modifying either the contents of the transcluded
tiddler - or simply the source parameter for the transclusion.
Let's assume your MainMenu contains the following string:
{{PseudoStory{<<tiddler [[Foo]]>>}}}
Then you could use the following code to change the displayed tiddler
from Foo to Bar:
---------------
var updatePseudoStory = function(container, source) {
var t = store.getTiddler(container);
// change transclusion source
var pattern = /({{PseudoStory{<<tiddler \[\[)(.+?)(]]>>}}})/;
var text = t.text.replace(pattern, "$1" + source + "$3");
store.saveTiddler(t.title, t.title, text, t.modifier, t.modified,
t.tags, t.fields, false, t.created);
};
updatePseudoStory("MainMenu", "Bar");
---------------
This might be simplified by reading the transclusion source from a
dedicated tiddler (or even just a variable) and applying that value
using evaluated parameters on the tiddler macro call. The respective
control would then refresh the containing the macro call.
-- F.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---