So you basically want two independent stories*?
That's currently not supported. There has been talk of this in the past,
but AFAICT nobody has made an effort to implement a prototype so far.
-- F.
You might use transclusion* for this, updating the transcluded tiddler
with the desired contents (make sure the container has the
refresh="content" attribute, like for example the main menu).
-- F.
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.
Hah, I didn't expect to see the Cookie Monster there - that actually
made me smile.
> Indeed, this problem for the first time made me read some js articles.
> However, it's daunting, as this would take me months for coming up
> with something usable myself.
I hope the sample code I provided helped getting you a sense of how to
get started.
>> 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.
>
> Had to read this sentence trice to understand half of what you meant -
> did I got it right?
> http://double.tiddlyspot.com/#SiteSubtitle%20flex
I'm not sure but it doesn't seem like what I had in mind (also see
below).
> You already used $1 and $3 within the script, so for the tiddler name
> and title to transclude only $2 and $4 are left
Well, this doesn't actually have anything to do with Tiddlywiki
transclusion; those are backreferences* from the RegEx search & replace.
> Now, only Opera chokes and gives the following error message
> [...]
> Statement on line 67: Syntax error in call to eval: line 5 :
> var pattern = /({{PseudoStory{<<tiddler \[\[)(.+?)(]]>>}}})
Looks like that might be a copy & paste error - or perhaps some weird
interaction due to the misunderstanding above?
> So much thanks again!
Your sample made me remember, wasn't there a navigation menu doing
something very similar, using tabs? It might have been Morris's work.
-- F.
I understand that. However, you have very specific demands there, and -
well, if you absolutely need a particular shape, but no such Lego brick
exists yet, someone's gonna have to mold it first.
-- F.